Author: stippi Date: 2010-09-15 10:35:47 +0200 (Wed, 15 Sep 2010) New Revision: 38658 Changeset: http://dev.haiku-os.org/changeset/38658 Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatReader.cpp Log: Use the correct field of the AVStream for the video frame rate (perhaps it changed in 0.6?). This fixes playback of several MP4 clips I have for testing. Modified: haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatReader.cpp =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatReader.cpp 2010-09-15 05:24:54 UTC (rev 38657) +++ haiku/trunk/src/add-ons/media/plugins/ffmpeg/AVFormatReader.cpp 2010-09-15 08:35:47 UTC (rev 38658) @@ -312,7 +312,6 @@ // Get a pointer to the AVCodecContext for the stream at streamIndex. AVCodecContext* codecContext = fStream->codec; - AVStream* stream = fStream; #if 0 // stippi: Here I was experimenting with the question if some fields of the @@ -606,11 +605,7 @@ // format->u.encoded_video.forward_history = 0; // format->u.encoded_video.backward_history = 0; - // TODO: Fix up for interlaced video - format->u.encoded_video.output.field_rate - = av_q2d(stream->r_frame_rate); -if (format->u.encoded_video.output.field_rate == 50.0f) - format->u.encoded_video.output.field_rate = 25.0f; + format->u.encoded_video.output.field_rate = FrameRate(); format->u.encoded_video.output.interlace = 1; format->u.encoded_video.output.first_active = 0; @@ -745,7 +740,10 @@ frameRate = (double)fStream->codec->sample_rate; break; case CODEC_TYPE_VIDEO: - frameRate = av_q2d(fStream->r_frame_rate); + frameRate = av_q2d(fStream->avg_frame_rate); + // TODO: Fix up interlaced video for real + if (frameRate == 50.0f) + frameRate = 25.0f; break; default: frameRate = 1.0;