diff mbox

[FFmpeg-devel] avformat/nutenc: Document trailer index assert better

Message ID 20181214205209.22253-1-michael@niedermayer.cc
State Accepted
Commit 3a95b73abc868995b08ca2b4d8bbf2cda43184f8
Headers show

Commit Message

Michael Niedermayer Dec. 14, 2018, 8:52 p.m. UTC
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavformat/nutenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Paul B Mahol Dec. 14, 2018, 8:59 p.m. UTC | #1
On 12/14/18, Michael Niedermayer <michael@niedermayer.cc> wrote:
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavformat/nutenc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c
> index a92ff55c01..e9a3bb49db 100644
> --- a/libavformat/nutenc.c
> +++ b/libavformat/nutenc.c
> @@ -1172,7 +1172,7 @@ static int nut_write_trailer(AVFormatContext *s)
>
>      ret = avio_open_dyn_buf(&dyn_bc);
>      if (ret >= 0 && nut->sp_count) {
> -        av_assert1(nut->write_index);
> +        av_assert1(nut->write_index); // sp_count should be 0 if no index
> is going to be written
>          write_index(nut, dyn_bc);
>          put_packet(nut, bc, dyn_bc, 1, INDEX_STARTCODE);
>      }
> --
> 2.19.2

Yea, figured it later, patch is fine.
Michael Niedermayer Dec. 16, 2018, 9:16 a.m. UTC | #2
On Fri, Dec 14, 2018 at 09:59:25PM +0100, Paul B Mahol wrote:
> On 12/14/18, Michael Niedermayer <michael@niedermayer.cc> wrote:
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > ---
> >  libavformat/nutenc.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c
> > index a92ff55c01..e9a3bb49db 100644
> > --- a/libavformat/nutenc.c
> > +++ b/libavformat/nutenc.c
> > @@ -1172,7 +1172,7 @@ static int nut_write_trailer(AVFormatContext *s)
> >
> >      ret = avio_open_dyn_buf(&dyn_bc);
> >      if (ret >= 0 && nut->sp_count) {
> > -        av_assert1(nut->write_index);
> > +        av_assert1(nut->write_index); // sp_count should be 0 if no index
> > is going to be written
> >          write_index(nut, dyn_bc);
> >          put_packet(nut, bc, dyn_bc, 1, INDEX_STARTCODE);
> >      }
> > --
> > 2.19.2
> 
> Yea, figured it later, patch is fine.

will apply

[...]
diff mbox

Patch

diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c
index a92ff55c01..e9a3bb49db 100644
--- a/libavformat/nutenc.c
+++ b/libavformat/nutenc.c
@@ -1172,7 +1172,7 @@  static int nut_write_trailer(AVFormatContext *s)
 
     ret = avio_open_dyn_buf(&dyn_bc);
     if (ret >= 0 && nut->sp_count) {
-        av_assert1(nut->write_index);
+        av_assert1(nut->write_index); // sp_count should be 0 if no index is going to be written
         write_index(nut, dyn_bc);
         put_packet(nut, bc, dyn_bc, 1, INDEX_STARTCODE);
     }