diff mbox series

[FFmpeg-devel,v2] avformat/movenc: handle tracks w/o AVStreams in calculate_mpeg4_bit_rates

Message ID 20200928205729.9064-1-jeebjp@gmail.com
State Accepted
Commit d9e812797c84be0f03aa1e95905da1f2cb2ed81e
Headers show
Series [FFmpeg-devel,v2] avformat/movenc: handle tracks w/o AVStreams in calculate_mpeg4_bit_rates
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Jan Ekström Sept. 28, 2020, 8:57 p.m. UTC
The generated text streams for chapters lack an AVStream since they
are but an internal concept within movenc.

Fixes #8190
---
 libavformat/movenc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Jan Ekström Sept. 28, 2020, 9:17 p.m. UTC | #1
On Mon, Sep 28, 2020 at 11:57 PM Jan Ekström <jeebjp@gmail.com> wrote:
>
> The generated text streams for chapters lack an AVStream since they
> are but an internal concept within movenc.
>
> Fixes #8190

Yes, I have now twice missed the fact that it is #8910 and not #8190.
But fret not, I have noticed my mistake by now :) .

Jan
Martin Storsjö Oct. 2, 2020, 9:33 a.m. UTC | #2
On Mon, 28 Sep 2020, Jan Ekström wrote:

> The generated text streams for chapters lack an AVStream since they
> are but an internal concept within movenc.
>
> Fixes #8190
> ---
> libavformat/movenc.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> index 20768cd45f..c1ff922e88 100644
> --- a/libavformat/movenc.c
> +++ b/libavformat/movenc.c
> @@ -641,10 +641,11 @@ struct mpeg4_bit_rate_values {
> 
> static struct mpeg4_bit_rate_values calculate_mpeg4_bit_rates(MOVTrack *track)
> {
> -    AVCPBProperties *props =
> +    AVCPBProperties *props = track->st ?
>         (AVCPBProperties*)av_stream_get_side_data(track->st,
>                                                   AV_PKT_DATA_CPB_PROPERTIES,
> -                                                  NULL);
> +                                                  NULL) :
> +        NULL;
>     struct mpeg4_bit_rate_values bit_rates = { 0 };
>
>     bit_rates.avg_bit_rate = compute_avg_bitrate(track);
> -- 
> 2.26.2

LGTM

// Martin
Jan Ekström Oct. 2, 2020, 3:44 p.m. UTC | #3
On Fri, Oct 2, 2020 at 12:33 PM Martin Storsjö <martin@martin.st> wrote:
>
> On Mon, 28 Sep 2020, Jan Ekström wrote:
>
> > The generated text streams for chapters lack an AVStream since they
> > are but an internal concept within movenc.
> >
> > Fixes #8190
> > ---
> > libavformat/movenc.c | 5 +++--
> > 1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> > index 20768cd45f..c1ff922e88 100644
> > --- a/libavformat/movenc.c
> > +++ b/libavformat/movenc.c
> > @@ -641,10 +641,11 @@ struct mpeg4_bit_rate_values {
> >
> > static struct mpeg4_bit_rate_values calculate_mpeg4_bit_rates(MOVTrack *track)
> > {
> > -    AVCPBProperties *props =
> > +    AVCPBProperties *props = track->st ?
> >         (AVCPBProperties*)av_stream_get_side_data(track->st,
> >                                                   AV_PKT_DATA_CPB_PROPERTIES,
> > -                                                  NULL);
> > +                                                  NULL) :
> > +        NULL;
> >     struct mpeg4_bit_rate_values bit_rates = { 0 };
> >
> >     bit_rates.avg_bit_rate = compute_avg_bitrate(track);
> > --
> > 2.26.2
>
> LGTM
>
> // Martin

Thanks. Applied as d9e812797c84be0f03aa1e95905da1f2cb2ed81e with the
ticket number fixed to 8910.

Jan
diff mbox series

Patch

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 20768cd45f..c1ff922e88 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -641,10 +641,11 @@  struct mpeg4_bit_rate_values {
 
 static struct mpeg4_bit_rate_values calculate_mpeg4_bit_rates(MOVTrack *track)
 {
-    AVCPBProperties *props =
+    AVCPBProperties *props = track->st ?
         (AVCPBProperties*)av_stream_get_side_data(track->st,
                                                   AV_PKT_DATA_CPB_PROPERTIES,
-                                                  NULL);
+                                                  NULL) :
+        NULL;
     struct mpeg4_bit_rate_values bit_rates = { 0 };
 
     bit_rates.avg_bit_rate = compute_avg_bitrate(track);