diff mbox

[FFmpeg-devel,3/5] avformat/ffmdec: Drop flags2, debug and codec->time_base setting

Message ID 20161202235258.26223-3-michael@niedermayer.cc
State Accepted
Headers show

Commit Message

Michael Niedermayer Dec. 2, 2016, 11:52 p.m. UTC
It should still be possible to set these through recommended_encoder_configuration

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavformat/ffmdec.c | 27 ++++++++-------------------
 1 file changed, 8 insertions(+), 19 deletions(-)

Comments

Andreas Cadhalpun Dec. 3, 2016, 11:48 a.m. UTC | #1
On 03.12.2016 00:52, Michael Niedermayer wrote:
> It should still be possible to set these through recommended_encoder_configuration
> 
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavformat/ffmdec.c | 27 ++++++++-------------------
>  1 file changed, 8 insertions(+), 19 deletions(-)
> 
> diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c
> index 25edeebb7e..f3497e2b24 100644
> --- a/libavformat/ffmdec.c
> +++ b/libavformat/ffmdec.c
> @@ -369,8 +369,8 @@ static int ffm2_read_header(AVFormatContext *s)
>                  goto fail;
>              }
>              codec->flags = avio_rb32(pb);
> -            codec->flags2 = avio_rb32(pb);
> -            codec->debug = avio_rb32(pb);
> +            avio_rb32(pb);
> +            avio_rb32(pb);

These (and the ones below) would also benefit from a code comment.

Best regards,
Andreas
Michael Niedermayer Dec. 3, 2016, 12:43 p.m. UTC | #2
On Sat, Dec 03, 2016 at 12:48:43PM +0100, Andreas Cadhalpun wrote:
> On 03.12.2016 00:52, Michael Niedermayer wrote:
> > It should still be possible to set these through recommended_encoder_configuration
> > 
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > ---
> >  libavformat/ffmdec.c | 27 ++++++++-------------------
> >  1 file changed, 8 insertions(+), 19 deletions(-)
> > 
> > diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c
> > index 25edeebb7e..f3497e2b24 100644
> > --- a/libavformat/ffmdec.c
> > +++ b/libavformat/ffmdec.c
> > @@ -369,8 +369,8 @@ static int ffm2_read_header(AVFormatContext *s)
> >                  goto fail;
> >              }
> >              codec->flags = avio_rb32(pb);
> > -            codec->flags2 = avio_rb32(pb);
> > -            codec->debug = avio_rb32(pb);
> > +            avio_rb32(pb);
> > +            avio_rb32(pb);
> 
> These (and the ones below) would also benefit from a code comment.

added locally

[...]
Andreas Cadhalpun Dec. 3, 2016, 1:09 p.m. UTC | #3
On 03.12.2016 13:43, Michael Niedermayer wrote:
> On Sat, Dec 03, 2016 at 12:48:43PM +0100, Andreas Cadhalpun wrote:
>> On 03.12.2016 00:52, Michael Niedermayer wrote:
>>> It should still be possible to set these through recommended_encoder_configuration
>>>
>>> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
>>> ---
>>>  libavformat/ffmdec.c | 27 ++++++++-------------------
>>>  1 file changed, 8 insertions(+), 19 deletions(-)
>>>
>>> diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c
>>> index 25edeebb7e..f3497e2b24 100644
>>> --- a/libavformat/ffmdec.c
>>> +++ b/libavformat/ffmdec.c
>>> @@ -369,8 +369,8 @@ static int ffm2_read_header(AVFormatContext *s)
>>>                  goto fail;
>>>              }
>>>              codec->flags = avio_rb32(pb);
>>> -            codec->flags2 = avio_rb32(pb);
>>> -            codec->debug = avio_rb32(pb);
>>> +            avio_rb32(pb);
>>> +            avio_rb32(pb);
>>
>> These (and the ones below) would also benefit from a code comment.
> 
> added locally

Thanks, patch is OK then.

Best regards,
Andreas
diff mbox

Patch

diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c
index 25edeebb7e..f3497e2b24 100644
--- a/libavformat/ffmdec.c
+++ b/libavformat/ffmdec.c
@@ -369,8 +369,8 @@  static int ffm2_read_header(AVFormatContext *s)
                 goto fail;
             }
             codec->flags = avio_rb32(pb);
-            codec->flags2 = avio_rb32(pb);
-            codec->debug = avio_rb32(pb);
+            avio_rb32(pb);
+            avio_rb32(pb);
             if (codec->flags & AV_CODEC_FLAG_GLOBAL_HEADER) {
                 int size = avio_rb32(pb);
                 if (size < 0 || size >= FF_MAX_EXTRADATA_SIZE) {
@@ -390,14 +390,8 @@  static int ffm2_read_header(AVFormatContext *s)
                 ret = AVERROR(EINVAL);
                 goto fail;
             }
-            codec->time_base.num = avio_rb32(pb);
-            codec->time_base.den = avio_rb32(pb);
-            if (codec->time_base.num <= 0 || codec->time_base.den <= 0) {
-                av_log(s, AV_LOG_ERROR, "Invalid time base %d/%d\n",
-                       codec->time_base.num, codec->time_base.den);
-                ret = AVERROR_INVALIDDATA;
-                goto fail;
-            }
+            avio_rb32(pb);
+            avio_rb32(pb);
             codecpar->width = avio_rb16(pb);
             codecpar->height = avio_rb16(pb);
             ret = av_image_check_size(codecpar->width, codecpar->height, 0, s);
@@ -603,18 +597,13 @@  static int ffm_read_header(AVFormatContext *s)
             goto fail;
         }
         codec->flags = avio_rb32(pb);
-        codec->flags2 = avio_rb32(pb);
-        codec->debug = avio_rb32(pb);
+        avio_rb32(pb);
+        avio_rb32(pb);
         /* specific info */
         switch(codecpar->codec_type) {
         case AVMEDIA_TYPE_VIDEO:
-            codec->time_base.num = avio_rb32(pb);
-            codec->time_base.den = avio_rb32(pb);
-            if (codec->time_base.num <= 0 || codec->time_base.den <= 0) {
-                av_log(s, AV_LOG_ERROR, "Invalid time base %d/%d\n",
-                       codec->time_base.num, codec->time_base.den);
-                goto fail;
-            }
+            avio_rb32(pb);
+            avio_rb32(pb);
             codecpar->width = avio_rb16(pb);
             codecpar->height = avio_rb16(pb);
             if (av_image_check_size(codecpar->width, codecpar->height, 0, s) < 0)