aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorAlex Converse <alex.converse@gmail.com>2011-12-13 18:49:06 -0800
committerAlex Converse <alex.converse@gmail.com>2011-12-21 22:04:37 -0800
commit4bf3c8f226252e18de8051fd0d417c1d39857b67 (patch)
treef2b1bccb16202512c24bc080a683a092c8c4174f /libavcodec
parentf264d336fe61c12ce9607c3060aa5d3dca947c61 (diff)
downloadffmpeg-4bf3c8f226252e18de8051fd0d417c1d39857b67.tar.gz
mov: Don't stick the QuickTime field ordering atom in extradata.
The 'fiel' atoms can be found in H.264 tracks clobbering the extradata. MJPEG supports non field based extradata, and this data should be preserved when copying.
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/avcodec.h15
-rw-r--r--libavcodec/mjpegdec.c9
2 files changed, 18 insertions, 6 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 6ce3224bfb..5d39b98123 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -1262,6 +1262,15 @@ typedef struct AVFrame {
struct AVCodecInternal;
+enum AVFieldOrder {
+ AV_FIELD_UNKNOWN,
+ AV_FIELD_PROGRESSIVE,
+ AV_FIELD_TT, //< Top coded_first, top displayed first
+ AV_FIELD_BB, //< Bottom coded first, bottom displayed first
+ AV_FIELD_TB, //< Top coded first, bottom displayed first
+ AV_FIELD_BT, //< Bottom coded first, top displayed first
+};
+
/**
* main external API structure.
* New fields can be added to the end with minor version bumps.
@@ -3108,6 +3117,12 @@ typedef struct AVCodecContext {
* libavcodec functions.
*/
struct AVCodecInternal *internal;
+
+ /** Field order
+ * - encoding: set by libavcodec
+ * - decoding: Set by libavcodec
+ */
+ enum AVFieldOrder field_order;
} AVCodecContext;
/**
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 17e87ed65b..058b08fa83 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -110,12 +110,9 @@ av_cold int ff_mjpeg_decode_init(AVCodecContext *avctx)
return AVERROR_INVALIDDATA;
}
}
- if (avctx->extradata_size > 9 &&
- AV_RL32(avctx->extradata + 4) == MKTAG('f','i','e','l')) {
- if (avctx->extradata[9] == 6) { /* quicktime icefloe 019 */
- s->interlace_polarity = 1; /* bottom field first */
- av_log(avctx, AV_LOG_DEBUG, "mjpeg bottom field first\n");
- }
+ if (avctx->field_order == AV_FIELD_BB) { /* quicktime icefloe 019 */
+ s->interlace_polarity = 1; /* bottom field first */
+ av_log(avctx, AV_LOG_DEBUG, "mjpeg bottom field first\n");
}
if (avctx->codec->id == CODEC_ID_AMV)
s->flipped = 1;