On 06/23/2013 11:16 PM, Justin Ruggles wrote:
> On 06/23/2013 05:00 PM, Rafaël Carré wrote:
>> ---
>>  libavformat/mux.c | 19 ++++++++++++-------
>>  1 file changed, 12 insertions(+), 7 deletions(-)
>>
>> diff --git a/libavformat/mux.c b/libavformat/mux.c
>> index 96193dd..eb91a5c 100644
>> --- a/libavformat/mux.c
>> +++ b/libavformat/mux.c
>> @@ -187,13 +187,18 @@ static int init_muxer(AVFormatContext *s, AVDictionary 
>> **options)
>>  
>>              if (av_cmp_q(st->sample_aspect_ratio,
>>                           codec->sample_aspect_ratio)) {
>> -                av_log(s, AV_LOG_ERROR, "Aspect ratio mismatch between 
>> muxer "
>> -                                        "(%d/%d) and encoder layer 
>> (%d/%d)\n",
>> -                       st->sample_aspect_ratio.num, 
>> st->sample_aspect_ratio.den,
>> -                       codec->sample_aspect_ratio.num,
>> -                       codec->sample_aspect_ratio.den);
>> -                ret = AVERROR(EINVAL);
>> -                goto fail;
>> +                if (st->sample_aspect_ratio.num != 0 &&
>> +                    st->sample_aspect_ratio.den != 0 &&
>> +                    codec->sample_aspect_ratio.den != 0 &&
>> +                    codec->sample_aspect_ratio.den != 0) {
>> +                    av_log(s, AV_LOG_ERROR, "Aspect ratio mismatch between 
>> muxer "
>> +                            "(%d/%d) and encoder layer (%d/%d)\n",
>> +                            st->sample_aspect_ratio.num, 
>> st->sample_aspect_ratio.den,
>> +                            codec->sample_aspect_ratio.num,
>> +                            codec->sample_aspect_ratio.den);
>> +                    ret = AVERROR(EINVAL);
>> +                    goto fail;
>> +                }
>>              }
>>              break;
>>          }
> 
> Seems fine to me. I have also run into this issue before.

It happens only if you are using memset over the packet instead the init
function.

Not sure what's the best outcome.

lu

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to