[Ffmpeg-devel] ffplay broken in latest svn

Nikns Siankin nikns
Tue Jan 9 11:30:58 CET 2007


On Tue, Jan 09, 2007 at 02:39:33AM +0100, Michael Niedermayer wrote:
>Hi
>
>On Mon, Jan 08, 2007 at 08:06:37PM +0200, Nikns Siankin wrote:
>> On Mon, Jan 08, 2007 at 05:05:10PM +0100, Michael Niedermayer wrote:
>> >Hi
>> >
>> >On Mon, Jan 08, 2007 at 05:04:32PM +0200, Nikns Siankin wrote:
>> >> On Fri, Jan 05, 2007 at 03:55:27PM +0100, Michael Niedermayer wrote:
>> >> >Hi
>> >> >
>> >> >On Wed, Jan 03, 2007 at 11:31:46AM +0200, Nikns Siankin wrote:
>> >> >> ffplay seems broken in svn 20070102.
>> [...]
>> >> >
>> >> >try to av_mallocz() duration_error and if it fixes the issue submit a patch
>> >> 
>> >> It fixed.
>> >> Here is patch:
[...]
>> 
>> --- libavformat/utils.c.orig	Tue Jan  2 22:35:46 2007
>> +++ libavformat/utils.c	Mon Jan  8 19:57:03 2007
>> @@ -1784,7 +1784,7 @@ int av_find_stream_info(AVFormatContext 
>>      AVPacketList *pktl=NULL, **ppktl;
>>      int64_t last_dts[MAX_STREAMS];
>>      int duration_count[MAX_STREAMS]={0};
>> -    double duration_error[MAX_STREAMS][MAX_STD_TIMEBASES]={{0}}; //FIXME malloc()?
>> +    double *duration_error = av_mallocz(MAX_STREAMS * MAX_STD_TIMEBASES * sizeof(duration_error));
>>  
>>      for(i=0;i<ic->nb_streams;i++) {
>>          st = ic->streams[i];
>> @@ -1896,12 +1896,12 @@ int av_find_stream_info(AVFormatContext 
>>  //                if(st->codec->codec_type == CODEC_TYPE_VIDEO)
>>  //                    av_log(NULL, AV_LOG_ERROR, "%f\n", dur);
>>                  if(duration_count[index] < 2)
>> -                    memset(duration_error, 0, sizeof(duration_error));
>> +                    memset(duration_error, 0, MAX_STREAMS * MAX_STD_TIMEBASES * sizeof(duration_error));
>>                  for(i=1; i<MAX_STD_TIMEBASES; i++){
>>                      int framerate= get_std_framerate(i);
>>                      int ticks= lrintf(dur*framerate/(1001*12));
>>                      double error= dur - ticks*1001*12/(double)framerate;
>> -                    duration_error[index][i] += error*error;
>> +                    duration_error[index*MAX_STREAMS+i] += error*error;
>
>double (*duration_error)[MAX_STD_TIMEBASES] = av_mallocz(MAX_STREAMS * MAX_STD_TIMEBASES * sizeof(duration_error));
>
>makes this and he next change unneeded
>
>except this iam fine with the patch ...
>

righty-right!

--- libavformat/utils.c.orig	Tue Jan  2 22:35:46 2007
+++ libavformat/utils.c	Tue Jan  9 11:54:36 2007
@@ -1784,7 +1784,7 @@ int av_find_stream_info(AVFormatContext 
     AVPacketList *pktl=NULL, **ppktl;
     int64_t last_dts[MAX_STREAMS];
     int duration_count[MAX_STREAMS]={0};
-    double duration_error[MAX_STREAMS][MAX_STD_TIMEBASES]={{0}}; //FIXME malloc()?
+    double (*duration_error)[MAX_STD_TIMEBASES] = av_mallocz(MAX_STREAMS * MAX_STD_TIMEBASES * sizeof(duration_error));
 
     for(i=0;i<ic->nb_streams;i++) {
         st = ic->streams[i];
@@ -1896,7 +1896,7 @@ int av_find_stream_info(AVFormatContext 
 //                if(st->codec->codec_type == CODEC_TYPE_VIDEO)
 //                    av_log(NULL, AV_LOG_ERROR, "%f\n", dur);
                 if(duration_count[index] < 2)
-                    memset(duration_error, 0, sizeof(duration_error));
+                    memset(duration_error, 0, MAX_STREAMS * MAX_STD_TIMEBASES * sizeof(duration_error));
                 for(i=1; i<MAX_STD_TIMEBASES; i++){
                     int framerate= get_std_framerate(i);
                     int ticks= lrintf(dur*framerate/(1001*12));
@@ -2016,6 +2016,9 @@ int av_find_stream_info(AVFormatContext 
         }
     }
 #endif
+
+    av_freep(&duration_error);
+
     return ret;
 }
 




More information about the ffmpeg-devel mailing list