Message ID | 20230427153954.48543-1-jamrial@gmail.com |
---|---|
State | Accepted |
Commit | 0275d994271ded88b3bf31b6d24686ecbc0e750d |
Headers | show |
Series | [FFmpeg-devel] avcodec/parser: fill avctx dimensions if unset | expand |
Context | Check | Description |
---|---|---|
andriy/make_x86 | success | Make finished |
andriy/make_fate_x86 | success | Make fate finished |
On 4/27/2023 12:39 PM, James Almer wrote: > This allows the usage of codecs in builds that have a parser but no decoders > for remuxing scenarios with raw sources. > > Signed-off-by: James Almer <jamrial@gmail.com> > --- > libavcodec/parser.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/libavcodec/parser.c b/libavcodec/parser.c > index 49de7e6a57..efc28b8918 100644 > --- a/libavcodec/parser.c > +++ b/libavcodec/parser.c > @@ -166,6 +166,10 @@ int av_parser_parse2(AVCodecParserContext *s, AVCodecContext *avctx, > #define FILL(name) if(s->name > 0 && avctx->name <= 0) avctx->name = s->name > if (avctx->codec_type == AVMEDIA_TYPE_VIDEO) { > FILL(field_order); > + FILL(coded_width); > + FILL(coded_height); > + FILL(width); > + FILL(height); > } > > /* update the file pointer */ Will apply.
diff --git a/libavcodec/parser.c b/libavcodec/parser.c index 49de7e6a57..efc28b8918 100644 --- a/libavcodec/parser.c +++ b/libavcodec/parser.c @@ -166,6 +166,10 @@ int av_parser_parse2(AVCodecParserContext *s, AVCodecContext *avctx, #define FILL(name) if(s->name > 0 && avctx->name <= 0) avctx->name = s->name if (avctx->codec_type == AVMEDIA_TYPE_VIDEO) { FILL(field_order); + FILL(coded_width); + FILL(coded_height); + FILL(width); + FILL(height); } /* update the file pointer */
This allows the usage of codecs in builds that have a parser but no decoders for remuxing scenarios with raw sources. Signed-off-by: James Almer <jamrial@gmail.com> --- libavcodec/parser.c | 4 ++++ 1 file changed, 4 insertions(+)