]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/mpegvideo_parser.c
Remove st1 and st2 temporary buffers in backward_filter() and use instead
[ffmpeg] / libavcodec / mpegvideo_parser.c
index 5b48b1ccef0e2eb07b6bbdd54f4214460e45f4ee..30f149d5476d683daed4bc64c44282c7e76c7665 100644 (file)
@@ -29,6 +29,7 @@ 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;
@@ -36,7 +37,6 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s,
     int horiz_size_ext, vert_size_ext, bit_rate_ext;
 //FIXME replace the crap with get_bits()
     s->repeat_pict = 0;
-    s->parity = 0;
     buf_end = buf + buf_size;
     while (buf < buf_end) {
         start_code= -1;
@@ -44,6 +44,8 @@ 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;
             }
@@ -177,5 +179,4 @@ AVCodecParser mpegvideo_parser = {
     NULL,
     mpegvideo_parse,
     ff_parse1_close,
-    mpegvideo_split,
 };