summaryrefslogtreecommitdiff
path: root/libavcodec/parser.c
diff options
context:
space:
mode:
authorRodger Combs <rodger.combs@gmail.com>2016-09-20 05:57:39 -0500
committerRodger Combs <rodger.combs@gmail.com>2016-10-24 01:20:18 -0500
commitd13740f3a207668f53ce167cf96f353379ac2c14 (patch)
tree9fa82acdd01914f23db8e385b860d615f9e0739f /libavcodec/parser.c
parent58672347cb20a45b12a5df514fe858572e1492e7 (diff)
lavc/parser: export field order if not already set
Some codecs set this in the parser, but not the decoder
Diffstat (limited to 'libavcodec/parser.c')
-rw-r--r--libavcodec/parser.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/parser.c b/libavcodec/parser.c
index 2c8fc69047..30cfc55cbc 100644
--- a/libavcodec/parser.c
+++ b/libavcodec/parser.c
@@ -182,6 +182,11 @@ int av_parser_parse2(AVCodecParserContext *s, AVCodecContext *avctx,
index = s->parser->parser_parse(s, avctx, (const uint8_t **) poutbuf,
poutbuf_size, buf, buf_size);
av_assert0(index > -0x20000000); // The API does not allow returning AVERROR codes
+#define FILL(name) if(s->name > 0 && avctx->name <= 0) avctx->name = s->name
+ if (avctx->codec_type == AVMEDIA_TYPE_VIDEO) {
+ FILL(field_order);
+ }
+
/* update the file pointer */
if (*poutbuf_size) {
/* fill the data for the current frame */