Commit 419ddbb8 authored by michael's avatar michael

always parse APP* as it sometimes contains startcodes which confuse the decoder otherwise


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@2927 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 1600a97b
...@@ -1532,7 +1532,8 @@ static int mjpeg_decode_app(MJpegDecodeContext *s) ...@@ -1532,7 +1532,8 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
{ {
int t_w, t_h; int t_w, t_h;
skip_bits(&s->gb, 8); /* the trailing zero-byte */ skip_bits(&s->gb, 8); /* the trailing zero-byte */
av_log(s->avctx, AV_LOG_INFO, "mjpeg: JFIF header found (version: %x.%x)\n", if (s->avctx->debug & FF_DEBUG_PICT_INFO)
av_log(s->avctx, AV_LOG_INFO, "mjpeg: JFIF header found (version: %x.%x)\n",
get_bits(&s->gb, 8), get_bits(&s->gb, 8)); get_bits(&s->gb, 8), get_bits(&s->gb, 8));
skip_bits(&s->gb, 8); skip_bits(&s->gb, 8);
...@@ -1553,7 +1554,8 @@ static int mjpeg_decode_app(MJpegDecodeContext *s) ...@@ -1553,7 +1554,8 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
if (id == ff_get_fourcc("Adob") && (get_bits(&s->gb, 8) == 'e')) if (id == ff_get_fourcc("Adob") && (get_bits(&s->gb, 8) == 'e'))
{ {
av_log(s->avctx, AV_LOG_INFO, "mjpeg: Adobe header found\n"); if (s->avctx->debug & FF_DEBUG_PICT_INFO)
av_log(s->avctx, AV_LOG_INFO, "mjpeg: Adobe header found\n");
skip_bits(&s->gb, 16); /* version */ skip_bits(&s->gb, 16); /* version */
skip_bits(&s->gb, 16); /* flags0 */ skip_bits(&s->gb, 16); /* flags0 */
skip_bits(&s->gb, 16); /* flags1 */ skip_bits(&s->gb, 16); /* flags1 */
...@@ -1563,7 +1565,8 @@ static int mjpeg_decode_app(MJpegDecodeContext *s) ...@@ -1563,7 +1565,8 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
} }
if (id == ff_get_fourcc("LJIF")){ if (id == ff_get_fourcc("LJIF")){
av_log(s->avctx, AV_LOG_INFO, "Pegasus lossless jpeg header found\n"); if (s->avctx->debug & FF_DEBUG_PICT_INFO)
av_log(s->avctx, AV_LOG_INFO, "Pegasus lossless jpeg header found\n");
skip_bits(&s->gb, 16); /* version ? */ skip_bits(&s->gb, 16); /* version ? */
skip_bits(&s->gb, 16); /* unknwon always 0? */ skip_bits(&s->gb, 16); /* unknwon always 0? */
skip_bits(&s->gb, 16); /* unknwon always 0? */ skip_bits(&s->gb, 16); /* unknwon always 0? */
...@@ -1602,7 +1605,7 @@ static int mjpeg_decode_app(MJpegDecodeContext *s) ...@@ -1602,7 +1605,7 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
skip_bits(&s->gb, 32); /* scan off */ skip_bits(&s->gb, 32); /* scan off */
skip_bits(&s->gb, 32); /* data off */ skip_bits(&s->gb, 32); /* data off */
#endif #endif
if (s->first_picture) if (s->avctx->debug & FF_DEBUG_PICT_INFO)
av_log(s->avctx, AV_LOG_INFO, "mjpeg: Apple MJPEG-A header found\n"); av_log(s->avctx, AV_LOG_INFO, "mjpeg: Apple MJPEG-A header found\n");
} }
} }
...@@ -1779,13 +1782,12 @@ static int mjpeg_decode_frame(AVCodecContext *avctx, ...@@ -1779,13 +1782,12 @@ static int mjpeg_decode_frame(AVCodecContext *avctx,
/* process markers */ /* process markers */
if (start_code >= 0xd0 && start_code <= 0xd7) { if (start_code >= 0xd0 && start_code <= 0xd7) {
dprintf("restart marker: %d\n", start_code&0x0f); dprintf("restart marker: %d\n", start_code&0x0f);
} else if (s->first_picture) {
/* APP fields */ /* APP fields */
if (start_code >= 0xe0 && start_code <= 0xef) } else if (start_code >= APP0 && start_code <= APP15) {
mjpeg_decode_app(s); mjpeg_decode_app(s);
/* Comment */ /* Comment */
else if (start_code == COM) } else if (start_code == COM){
mjpeg_decode_com(s); mjpeg_decode_com(s);
} }
switch(start_code) { switch(start_code) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment