~ubuntu-branches/ubuntu/utopic/vlc/utopic

« back to all changes in this revision

Viewing changes to modules/demux/image.c

  • Committer: Package Import Robot
  • Author(s): Benjamin Drung
  • Date: 2012-02-18 01:29:48 UTC
  • mfrom: (1.1.45) (3.5.32 sid)
  • Revision ID: package-import@ubuntu.com-20120218012948-tvq9nhnfi98kra44
Tags: 2.0.0-1
* New upstream release (Closes: #499381, #573064, #624027, LP: #455825,
  #573775, #695882, #705151, #708448, #738381, #743581, #747757, #817924,
  #931083).
* Remove dropped mozilla-plugin-vlc, vlc-plugin-ggi, and vlc-plugin-svgalib.
  The Mozilla browser plug-in is now provided by a separate source tarball.
* Add new plugins to and remove dropped plugins from vlc-nox.
* Add new and remove dropped build dependencies:
  + libbluray-dev (for Blu-ray support)
  + libresid-builder-dev
  + libsamplerate0-dev
  + libsidplay2-dev
  + lbspeexdsp-dev
  + libxcb-composite0-dev
  - libgtk2.0-dev
  - xulrunner-dev
* vlc-plugin-fluidsynth depends on fluid-soundfont-gm or
  musescore-soundfont-gm for having a sound font for playing MIDI files.
* Drop all patches (they were either backported or accepted by upstream).
* Update symbols for libvlc5.
* Install plugins.dat instead of running vlc-cache-gen in postinst.
* Update minimum version of build dependencies.
* Change Build-Dependency from libupnp3-dev to unversioned libupnp-dev.
  (Closes: #656831)

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * image.c: Image demuxer
3
3
 *****************************************************************************
4
4
 * Copyright (C) 2010 Laurent Aimar
5
 
 * $Id: 892140471a313fbeeb8b0750fd3e3c9dc31a5956 $
 
5
 * $Id: f2fb8ac542ae03557238db1e938e8d3c343b433e $
6
6
 *
7
7
 * Authors: Laurent Aimar <fenrir _AT_ videolan _DOT_ org>
8
8
 *
404
404
    return true;
405
405
}
406
406
 
 
407
static bool IsExif(stream_t *s)
 
408
{
 
409
    const uint8_t *header;
 
410
    int size = stream_Peek(s, &header, 256);
 
411
    int position = 0;
 
412
 
 
413
    if (FindJpegMarker(&position, header, size) != 0xd8)
 
414
        return false;
 
415
    if (FindJpegMarker(&position, header, size) != 0xe1)
 
416
        return false;
 
417
    position += 2;  /* Skip size */
 
418
    if (position + 5 > size)
 
419
        return false;
 
420
    if (memcmp(&header[position], "Exif\0", 5))
 
421
        return false;
 
422
    return true;
 
423
}
 
424
 
407
425
static bool IsTarga(stream_t *s)
408
426
{
409
427
    /* The header is not enough to ensure proper detection, we need
513
531
    { .codec = VLC_CODEC_JPEG,
514
532
      .detect = IsSpiff,
515
533
    },
 
534
    { .codec = VLC_CODEC_JPEG,
 
535
      .detect = IsExif,
 
536
    },
516
537
    { .codec = VLC_CODEC_TARGA,
517
538
      .detect = IsTarga,
518
539
    },