[FFmpeg-devel] movenc: fix warning if CONFIG_AC3_PARSER not defined

Submitted by Alfred E. Heggestad on July 2, 2019, 12:19 p.m.

Details

Message ID 1e00eb0b-18ae-94c3-afbf-99d0d78ef8a0@gmail.com
State New
Headers show

Commit Message

Alfred E. Heggestad July 2, 2019, 12:19 p.m.
this patch fixes a compiler warning if CONFIG_AC3_PARSER is
not defined. The label 'end' is removed and all the code
use the label 'err' instead.
---
  libavformat/movenc.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)

      } else {
@@ -5533,7 +5533,6 @@ int ff_mov_write_packet(AVFormatContext *s, 
AVPacket *pkt)
          ff_mov_add_hinted_packet(s, pkt, trk->hint_track, trk->entry,
                                   reformatted_data, size);

-end:
  err:

      av_free(reformatted_data);

Comments

Michael Niedermayer July 3, 2019, 7:28 p.m.
On Tue, Jul 02, 2019 at 02:19:37PM +0200, Alfred E. Heggestad wrote:
> this patch fixes a compiler warning if CONFIG_AC3_PARSER is
> not defined. The label 'end' is removed and all the code
> use the label 'err' instead.

What compiler warning (this should be in the commit message)

"goto err" in the case where its not an error would require a comment

Thanks

[...]
Alfred E. Heggestad July 4, 2019, 8:15 a.m.
On 03/07/2019 21:28, Michael Niedermayer wrote:
> On Tue, Jul 02, 2019 at 02:19:37PM +0200, Alfred E. Heggestad wrote:
>> this patch fixes a compiler warning if CONFIG_AC3_PARSER is
>> not defined. The label 'end' is removed and all the code
>> use the label 'err' instead.
> 
> What compiler warning (this should be in the commit message)
> 
> "goto err" in the case where its not an error would require a comment
> 

hi,

here is the compiler warning:


CC	libavformat/movenc.o
libavformat/movenc.c:5536:1: warning: unused label 'end' [-Wunused-label]
end:
^~~~
1 warning generated.



compiler is clang 10.0.1 on OSX 10.14




/alfred

Patch hide | download patch | download mbox

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 46d314ff17..f1a226313e 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -5379,7 +5379,7 @@  int ff_mov_write_packet(AVFormatContext *s, 
AVPacket *pkt)
          if (size < 0)
              return size;
          else if (!size)
-            goto end;
+            goto err;
          avio_write(pb, pkt->data, size);
  #endif