]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/mpegvideo_parser.c
Call ff_fetch_timestamp() for mpeg1/2 when a picture start code is found instead
[ffmpeg] / libavcodec / mpegvideo_parser.c
index 2ccb9fff2c7072b64417a4984e11d6737648cb22..215c86c4001b1e23269f6fbf04a4e7fbe78ae4d0 100644 (file)
@@ -29,7 +29,6 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s,
 {
     ParseContext1 *pc = s->priv_data;
     const uint8_t *buf_end;
-    const uint8_t *buf_start= buf;
     uint32_t start_code;
     int frame_rate_index, ext_type, bytes_left;
     int frame_rate_ext_n, frame_rate_ext_d;
@@ -44,8 +43,6 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s,
         bytes_left = buf_end - buf;
         switch(start_code) {
         case PICTURE_START_CODE:
-            ff_fetch_timestamp(s, buf-buf_start-4, 1);
-
             if (bytes_left >= 2) {
                 s->pict_type = (buf[1] >> 3) & 7;
             }
@@ -137,7 +134,7 @@ static int mpegvideo_parse(AVCodecParserContext *s,
     if(s->flags & PARSER_FLAG_COMPLETE_FRAMES){
         next= buf_size;
     }else{
-        next= ff_mpeg1_find_frame_end(pc, buf, buf_size);
+        next= ff_mpeg1_find_frame_end(pc, buf, buf_size, s);
 
         if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) {
             *poutbuf = NULL;