Message ID | 20200511142756.1868-2-jamrial@gmail.com |
---|---|
State | Accepted |
Headers | show |
Series | [FFmpeg-devel,1/2] avcodec/libdav1d: try to set decoder context parameters during init() | expand |
Context | Check | Description |
---|---|---|
andriy/default | pending | |
andriy/make | success | Make finished |
andriy/make_fate | success | Make fate finished |
Quoting James Almer (2020-05-11 16:27:56) > Signed-off-by: James Almer <jamrial@gmail.com> > --- > libavcodec/libdav1d.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c > index 72f06c550e..a265a487d8 100644 > --- a/libavcodec/libdav1d.c > +++ b/libavcodec/libdav1d.c > @@ -335,6 +335,12 @@ static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame) > goto fail; > } > > + av_reduce(&frame->sample_aspect_ratio.num, > + &frame->sample_aspect_ratio.den, > + frame->height * (int64_t)p->frame_hdr->render_width, > + frame->width * (int64_t)p->frame_hdr->render_height, > + INT_MAX); Wondered whether av_div_q might make it look better, but probably not by much. Patch looks ok.
On 5/18/2020 12:16 PM, Anton Khirnov wrote: > Quoting James Almer (2020-05-11 16:27:56) >> Signed-off-by: James Almer <jamrial@gmail.com> >> --- >> libavcodec/libdav1d.c | 6 ++++++ >> 1 file changed, 6 insertions(+) >> >> diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c >> index 72f06c550e..a265a487d8 100644 >> --- a/libavcodec/libdav1d.c >> +++ b/libavcodec/libdav1d.c >> @@ -335,6 +335,12 @@ static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame) >> goto fail; >> } >> >> + av_reduce(&frame->sample_aspect_ratio.num, >> + &frame->sample_aspect_ratio.den, >> + frame->height * (int64_t)p->frame_hdr->render_width, >> + frame->width * (int64_t)p->frame_hdr->render_height, >> + INT_MAX); > > Wondered whether av_div_q might make it look better, but probably not by > much. > > Patch looks ok. Pushed, thanks.
diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c index 72f06c550e..a265a487d8 100644 --- a/libavcodec/libdav1d.c +++ b/libavcodec/libdav1d.c @@ -335,6 +335,12 @@ static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame) goto fail; } + av_reduce(&frame->sample_aspect_ratio.num, + &frame->sample_aspect_ratio.den, + frame->height * (int64_t)p->frame_hdr->render_width, + frame->width * (int64_t)p->frame_hdr->render_height, + INT_MAX); + if (p->m.user_data.data) memcpy(&frame->reordered_opaque, p->m.user_data.data, sizeof(frame->reordered_opaque)); else
Signed-off-by: James Almer <jamrial@gmail.com> --- libavcodec/libdav1d.c | 6 ++++++ 1 file changed, 6 insertions(+)