]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
In mpeg1/2 timestamps (against all logic) are associated with
authormichael <michael@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Tue, 3 Jun 2008 02:43:17 +0000 (02:43 +0000)
committermichael <michael@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Tue, 3 Jun 2008 02:43:17 +0000 (02:43 +0000)
picture start codes and not with access units. Fix the parser to
handle that properly. This was a very long standing bug ...
The change to the seek regressions is because the mpeg ts muxer
stores too many invalid and randomized timestamps which overflow
the 4 entry buffer we use in the parser.

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@13643 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavcodec/mpegvideo_parser.c
tests/seek.regression.ref

index 25d1ddc045a7d53be00da771eedf93832a5120d2..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;
@@ -43,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;
             }
index 63bd454dc71a1855c1370f3f219c551c9566e12e..9d8ca2e36d6d64ec8ae46f79d8b2cfbe67cb318d 100644 (file)
@@ -3481,7 +3481,7 @@ ret:-1 st:-1 ts:0.460008 flags:0
 ret:-1 st:-1 ts:-0.645825 flags:1
 ----------------
 tests/data/b-libav.ts
-ret: 0 st: 0 dts:-0.040000 pts:0.000000 pos:-1 size:24921 flags:1
+ret: 0 st: 0 dts:0.000000 pts:-102481911520608.625000 pos:-1 size:24921 flags:1
 ret: 0 st:-1 ts:-1.000000 flags:0
 ret: 0 st: 0 dts:0.000000 pts:-102481911520608.625000 pos:-1 size:22036 flags:1
 ret: 0 st:-1 ts:1.894167 flags:1