diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-05-18 14:02:31 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-05-18 14:02:31 +0200 |
commit | 213e82b55c28d28860ec9a7ace8335df860a4c50 (patch) | |
tree | d1996e13fdfd392ee530b2bea60c029acc0923c9 | |
parent | 56d3cd1455ea1970165a3ca047a97c3e43a9e9aa (diff) | |
parent | b513bf6f69e26e724de6d5dca642c3582dcd0517 (diff) | |
download | ffmpeg-streaming-213e82b55c28d28860ec9a7ace8335df860a4c50.zip ffmpeg-streaming-213e82b55c28d28860ec9a7ace8335df860a4c50.tar.gz |
Merge commit 'b513bf6f69e26e724de6d5dca642c3582dcd0517'
* commit 'b513bf6f69e26e724de6d5dca642c3582dcd0517':
yuv4mpegdec: do not set coded_frame properties
Conflicts:
libavformat/yuv4mpegdec.c
See: b45a3e167f497d82effbf8ada453ea47b0ee21da
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/yuv4mpegdec.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/libavformat/yuv4mpegdec.c b/libavformat/yuv4mpegdec.c index 120630f..c02b291 100644 --- a/libavformat/yuv4mpegdec.c +++ b/libavformat/yuv4mpegdec.c @@ -31,7 +31,7 @@ static int yuv4_read_header(AVFormatContext *s) { char header[MAX_YUV4_HEADER + 10]; // Include headroom for // the longest option - char *tokstart, *tokend, *header_end, interlaced = '?'; + char *tokstart, *tokend, *header_end; int i; AVIOContext *pb = s->pb; int width = -1, height = -1, raten = 0, @@ -39,6 +39,7 @@ static int yuv4_read_header(AVFormatContext *s) enum AVPixelFormat pix_fmt = AV_PIX_FMT_NONE, alt_pix_fmt = AV_PIX_FMT_NONE; enum AVChromaLocation chroma_sample_location = AVCHROMA_LOC_UNSPECIFIED; AVStream *st; + enum AVFieldOrder field_order; for (i = 0; i < MAX_YUV4_HEADER; i++) { header[i] = avio_r8(pb); @@ -134,7 +135,26 @@ static int yuv4_read_header(AVFormatContext *s) tokstart++; break; case 'I': // Interlace type - interlaced = *tokstart++; + switch (*tokstart++){ + case '?': + field_order = AV_FIELD_UNKNOWN; + break; + case 'p': + field_order = AV_FIELD_PROGRESSIVE; + break; + case 't': + field_order = AV_FIELD_TT; + break; + case 'b': + field_order = AV_FIELD_BB; + break; + case 'm': + av_log(s, AV_LOG_ERROR, "YUV4MPEG stream contains mixed " + "interlaced and non-interlaced frames.\n"); + default: + av_log(s, AV_LOG_ERROR, "YUV4MPEG has invalid header.\n"); + return AVERROR(EINVAL); + } break; case 'F': // Frame rate sscanf(tokstart, "%d:%d", &raten, &rated); // 0:0 if unknown @@ -235,27 +255,7 @@ static int yuv4_read_header(AVFormatContext *s) st->codec->codec_id = AV_CODEC_ID_RAWVIDEO; st->sample_aspect_ratio = (AVRational){ aspectn, aspectd }; st->codec->chroma_sample_location = chroma_sample_location; - - switch (interlaced){ - case 'p': - st->codec->field_order = AV_FIELD_PROGRESSIVE; - break; - case 't': - st->codec->field_order = AV_FIELD_TB; - break; - case 'b': - st->codec->field_order = AV_FIELD_BT; - break; - case 'm': - av_log(s, AV_LOG_ERROR, "YUV4MPEG stream contains mixed " - "interlaced and non-interlaced frames.\n"); - case '?': - st->codec->field_order = AV_FIELD_UNKNOWN; - break; - default: - av_log(s, AV_LOG_ERROR, "YUV4MPEG has invalid header.\n"); - return AVERROR(EINVAL); - } + st->codec->field_order = field_order; return 0; } |