[FFmpeg-devel] [PATCH] fftools/ffmpeg_opt: restore to use codec_info_nb_frames to calculate score
Linjie Fu
linjie.justin.fu at gmail.com
Sun Jan 24 16:43:37 EET 2021
On Sun, Jan 24, 2021 at 9:38 PM James Almer <jamrial at gmail.com> wrote:
>
> On 1/24/2021 10:00 AM, Linjie Fu wrote:
> > From: Linjie Fu <linjie.fulinjie at alibaba-inc.com>
> >
> > Regression since 87f0c8280.
> >
> > If the extradata of a stream could not be extracted correctly,
> > codec_info_nb_frames would remain zero, while st->event_flag would still
> > be marked as AVSTREAM_EVENT_FLAG_NEW_PACKETS since it's a new packet
> > indeed.
> >
> > The two expressions could be different in this case, hence restore to
> > calculate the correct score.
> >
> > Fix #9029.
>
> codec_info_nb_frames is not public, which is why its usage was removed,
> so this patch is not ok.
Okay, thx.
> A proper fix would perhaps be to reset event_flags after this, as its
> API says it should. Can you try that and see if it works?
>
Yes it works, and I've tried this before I sent this patch out.
However, what makes me hesitant is the definition of
AVSTREAM_EVENT_FLAG_NEW_PACKETS , which says this flag indicates "new
packets for this stream were read from the file".
IIRC the behaviour in this case matches the definition well, hence I
didn't reset event_flags to zero at first.
Will send it out for discussion as well, thx.
- linjie
More information about the ffmpeg-devel
mailing list