[FFmpeg-devel] [PATCH] Fix distortion problem in MPEG1/2 video

Heesuk Jung heesuk.jung at lge.com
Tue Nov 20 04:48:02 CET 2012


Hi

Carl Eugen writes:
> You could just leave this line and remove the default case below (but feel
free to ignore, esp. since then you should probably change the case to an
if).
> The two case statements should be merged.

I made new one as your comment.

Thanks

>From e87fb67bd487b947219ac0bddfd2f231bc418699 Mon Sep 17 00:00:00 2001
From: Heesuk Jung <heesuk.jung at lge.com>
Date: Sat, 17 Nov 2012 13:52:50 +0900
Subject: [PATCH] Fix distortion problem in MPEG1/2 video

In some MPEG1/2 AVI files, there are video distortion problem in bottom of
screen.
(I just test files by ffplay)

1. MPEG1 video problematic file link
 - https://docs.google.com/open?id=0B6r7ZfWFIypCMkltZHJDY0pQN1U
2. MPEG2 video problematic file link
 - https://docs.google.com/open?id=0B6r7ZfWFIypCM0ZremxpbXc1N3c

Suggests to use AVSTREAM_PARSE_FULL option in prblematic cases.
---
 libavformat/avidec.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 0314b4d..7d3367d 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -636,6 +636,10 @@ static int avi_read_header(AVFormatContext *s)
                     st->codec->codec_tag = tag1;
                     st->codec->codec_id =
ff_codec_get_id(ff_codec_bmp_tags, tag1);
                     st->need_parsing = AVSTREAM_PARSE_HEADERS; // This is
needed to get the pict type which is necessary for generating correct pts.
+                    if (st->codec->codec_id == AV_CODEC_ID_MPEG1VIDEO ||
+                        st->codec->codec_id == AV_CODEC_ID_MPEG2VIDEO) {
+                        st->need_parsing = AVSTREAM_PARSE_FULL;
+                    }
 
                     if(st->codec->codec_tag==0 && st->codec->height > 0 &&
st->codec->extradata_size < 1U<<30){
                         st->codec->extradata_size+= 9;
-- 
1.8.0

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-distortion-problem-in-MPEG1-2-video.patch
Type: application/octet-stream
Size: 1570 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20121120/74e3e40e/attachment.obj>


More information about the ffmpeg-devel mailing list