[FFmpeg-devel] avformat/hcom: Fix "set but not used" warnings

Submitted by Michael Niedermayer on Jan. 19, 2019, 6:50 p.m.

Details

Message ID 20190119185005.28334-1-michael@niedermayer.cc
State New
Headers show

Commit Message

Michael Niedermayer Jan. 19, 2019, 6:50 p.m.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavformat/hcom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

James Almer Jan. 19, 2019, 6:53 p.m.
On 1/19/2019 3:50 PM, Michael Niedermayer wrote:
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavformat/hcom.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/hcom.c b/libavformat/hcom.c
> index 35515cc5b2..6d3d726fa5 100644
> --- a/libavformat/hcom.c
> +++ b/libavformat/hcom.c
> @@ -38,7 +38,7 @@ static int hcom_probe(AVProbeData *p)
>  static int hcom_read_header(AVFormatContext *s)
>  {
>      AVStream *st;
> -    unsigned data_size, rsrc_size, huffcount;
> +    av_unused unsigned data_size, rsrc_size, huffcount;
>      unsigned compresstype, divisor;
>      unsigned dict_entries;
>      int ret;

No, they should be removed and the relevant avio_rb32() replaced with
avio_skip() alongside a comment to document what those bytes represent.
Michael Niedermayer Jan. 19, 2019, 7:08 p.m.
On Sat, Jan 19, 2019 at 03:53:55PM -0300, James Almer wrote:
> On 1/19/2019 3:50 PM, Michael Niedermayer wrote:
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > ---
> >  libavformat/hcom.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/libavformat/hcom.c b/libavformat/hcom.c
> > index 35515cc5b2..6d3d726fa5 100644
> > --- a/libavformat/hcom.c
> > +++ b/libavformat/hcom.c
> > @@ -38,7 +38,7 @@ static int hcom_probe(AVProbeData *p)
> >  static int hcom_read_header(AVFormatContext *s)
> >  {
> >      AVStream *st;
> > -    unsigned data_size, rsrc_size, huffcount;
> > +    av_unused unsigned data_size, rsrc_size, huffcount;
> >      unsigned compresstype, divisor;
> >      unsigned dict_entries;
> >      int ret;
> 
> No, they should be removed and the relevant avio_rb32() replaced with
> avio_skip() alongside a comment to document what those bytes represent.

I thought there might be some future code or checks that will use these
but if thats not the case then sure i can remove them

thx
James Almer Jan. 19, 2019, 7:11 p.m.
On 1/19/2019 4:08 PM, Michael Niedermayer wrote:
> On Sat, Jan 19, 2019 at 03:53:55PM -0300, James Almer wrote:
>> On 1/19/2019 3:50 PM, Michael Niedermayer wrote:
>>> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
>>> ---
>>>  libavformat/hcom.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/libavformat/hcom.c b/libavformat/hcom.c
>>> index 35515cc5b2..6d3d726fa5 100644
>>> --- a/libavformat/hcom.c
>>> +++ b/libavformat/hcom.c
>>> @@ -38,7 +38,7 @@ static int hcom_probe(AVProbeData *p)
>>>  static int hcom_read_header(AVFormatContext *s)
>>>  {
>>>      AVStream *st;
>>> -    unsigned data_size, rsrc_size, huffcount;
>>> +    av_unused unsigned data_size, rsrc_size, huffcount;
>>>      unsigned compresstype, divisor;
>>>      unsigned dict_entries;
>>>      int ret;
>>
>> No, they should be removed and the relevant avio_rb32() replaced with
>> avio_skip() alongside a comment to document what those bytes represent.
> 
> I thought there might be some future code or checks that will use these
> but if thats not the case then sure i can remove them
> 
> thx

data_size could i guess be used to set stream duration, but i doubt this
demuxer will get much more development than what's already done.
Michael Niedermayer Jan. 19, 2019, 10:54 p.m.
On Sat, Jan 19, 2019 at 04:11:07PM -0300, James Almer wrote:
> On 1/19/2019 4:08 PM, Michael Niedermayer wrote:
> > On Sat, Jan 19, 2019 at 03:53:55PM -0300, James Almer wrote:
> >> On 1/19/2019 3:50 PM, Michael Niedermayer wrote:
> >>> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> >>> ---
> >>>  libavformat/hcom.c | 2 +-
> >>>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>>
> >>> diff --git a/libavformat/hcom.c b/libavformat/hcom.c
> >>> index 35515cc5b2..6d3d726fa5 100644
> >>> --- a/libavformat/hcom.c
> >>> +++ b/libavformat/hcom.c
> >>> @@ -38,7 +38,7 @@ static int hcom_probe(AVProbeData *p)
> >>>  static int hcom_read_header(AVFormatContext *s)
> >>>  {
> >>>      AVStream *st;
> >>> -    unsigned data_size, rsrc_size, huffcount;
> >>> +    av_unused unsigned data_size, rsrc_size, huffcount;
> >>>      unsigned compresstype, divisor;
> >>>      unsigned dict_entries;
> >>>      int ret;
> >>
> >> No, they should be removed and the relevant avio_rb32() replaced with
> >> avio_skip() alongside a comment to document what those bytes represent.
> > 
> > I thought there might be some future code or checks that will use these
> > but if thats not the case then sure i can remove them
> > 
> > thx
> 
> data_size could i guess be used to set stream duration, 

where can i find hcom samples ?
do you have some URLs ? 
(for testing such use of the field)


> but i doubt this
> demuxer will get much more development than what's already done.

maybe


[...]
James Almer Jan. 20, 2019, 12:12 a.m.
On 1/19/2019 7:54 PM, Michael Niedermayer wrote:
> On Sat, Jan 19, 2019 at 04:11:07PM -0300, James Almer wrote:
>> On 1/19/2019 4:08 PM, Michael Niedermayer wrote:
>>> On Sat, Jan 19, 2019 at 03:53:55PM -0300, James Almer wrote:
>>>> On 1/19/2019 3:50 PM, Michael Niedermayer wrote:
>>>>> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
>>>>> ---
>>>>>  libavformat/hcom.c | 2 +-
>>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/libavformat/hcom.c b/libavformat/hcom.c
>>>>> index 35515cc5b2..6d3d726fa5 100644
>>>>> --- a/libavformat/hcom.c
>>>>> +++ b/libavformat/hcom.c
>>>>> @@ -38,7 +38,7 @@ static int hcom_probe(AVProbeData *p)
>>>>>  static int hcom_read_header(AVFormatContext *s)
>>>>>  {
>>>>>      AVStream *st;
>>>>> -    unsigned data_size, rsrc_size, huffcount;
>>>>> +    av_unused unsigned data_size, rsrc_size, huffcount;
>>>>>      unsigned compresstype, divisor;
>>>>>      unsigned dict_entries;
>>>>>      int ret;
>>>>
>>>> No, they should be removed and the relevant avio_rb32() replaced with
>>>> avio_skip() alongside a comment to document what those bytes represent.
>>>
>>> I thought there might be some future code or checks that will use these
>>> but if thats not the case then sure i can remove them
>>>
>>> thx
>>
>> data_size could i guess be used to set stream duration, 
> 
> where can i find hcom samples ?
> do you have some URLs ? 
> (for testing such use of the field)

Paul should know since he wrote both the decoder and demuxer. Also Compn
i think.

> 
> 
>> but i doubt this
>> demuxer will get much more development than what's already done.
> 
> maybe
> 
> 
> [...]
> 
> 
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
Michael Niedermayer Jan. 30, 2019, 9:25 p.m.
On Sat, Jan 19, 2019 at 09:12:41PM -0300, James Almer wrote:
> On 1/19/2019 7:54 PM, Michael Niedermayer wrote:
> > On Sat, Jan 19, 2019 at 04:11:07PM -0300, James Almer wrote:
> >> On 1/19/2019 4:08 PM, Michael Niedermayer wrote:
> >>> On Sat, Jan 19, 2019 at 03:53:55PM -0300, James Almer wrote:
> >>>> On 1/19/2019 3:50 PM, Michael Niedermayer wrote:
> >>>>> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> >>>>> ---
> >>>>>  libavformat/hcom.c | 2 +-
> >>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>>>>
> >>>>> diff --git a/libavformat/hcom.c b/libavformat/hcom.c
> >>>>> index 35515cc5b2..6d3d726fa5 100644
> >>>>> --- a/libavformat/hcom.c
> >>>>> +++ b/libavformat/hcom.c
> >>>>> @@ -38,7 +38,7 @@ static int hcom_probe(AVProbeData *p)
> >>>>>  static int hcom_read_header(AVFormatContext *s)
> >>>>>  {
> >>>>>      AVStream *st;
> >>>>> -    unsigned data_size, rsrc_size, huffcount;
> >>>>> +    av_unused unsigned data_size, rsrc_size, huffcount;
> >>>>>      unsigned compresstype, divisor;
> >>>>>      unsigned dict_entries;
> >>>>>      int ret;
> >>>>
> >>>> No, they should be removed and the relevant avio_rb32() replaced with
> >>>> avio_skip() alongside a comment to document what those bytes represent.
> >>>
> >>> I thought there might be some future code or checks that will use these
> >>> but if thats not the case then sure i can remove them
> >>>
> >>> thx
> >>
> >> data_size could i guess be used to set stream duration, 
> > 
> > where can i find hcom samples ?
> > do you have some URLs ? 
> > (for testing such use of the field)
> 
> Paul should know since he wrote both the decoder and demuxer. Also Compn
> i think.

ping, does someone have a sample for this ?

[...]

Patch hide | download patch | download mbox

diff --git a/libavformat/hcom.c b/libavformat/hcom.c
index 35515cc5b2..6d3d726fa5 100644
--- a/libavformat/hcom.c
+++ b/libavformat/hcom.c
@@ -38,7 +38,7 @@  static int hcom_probe(AVProbeData *p)
 static int hcom_read_header(AVFormatContext *s)
 {
     AVStream *st;
-    unsigned data_size, rsrc_size, huffcount;
+    av_unused unsigned data_size, rsrc_size, huffcount;
     unsigned compresstype, divisor;
     unsigned dict_entries;
     int ret;