aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2008-01-05 01:14:09 +0000
committerMichael Niedermayer <michaelni@gmx.at>2008-01-05 01:14:09 +0000
commit9bd005bdbcb6494557cff7392a141fb3f9c3c761 (patch)
tree76cabc9b01599505ad2784fad6125067b1e73da3
parent977cbe79d84d27d8324509b5fc93e494c8be51fc (diff)
downloadffmpeg-9bd005bdbcb6494557cff7392a141fb3f9c3c761.tar.gz
Drop non key frames before the first key frame.
Originally committed as revision 11411 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/mpeg12.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index ed7409157a..5b006c3c0f 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -2329,8 +2329,10 @@ static int mpeg_decode_frame(AVCodecContext *avctx,
if(s2->last_picture_ptr==NULL){
/* Skip B-frames if we do not have reference frames. */
if(s2->pict_type==B_TYPE) break;
+ }
+ if(s2->next_picture_ptr==NULL){
/* Skip P-frames if we do not have reference frame no valid header. */
-// if(s2->pict_type==P_TYPE && s2->first_field && !s2->first_slice) break;
+ if(s2->pict_type==P_TYPE && (s2->first_field || s2->picture_structure==PICT_FRAME)) break;
}
/* Skip B-frames if we are in a hurry. */
if(avctx->hurry_up && s2->pict_type==B_TYPE) break;