]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/mpeg.c
mov: Wrap stsc index and count compare in a separate function
[ffmpeg] / libavformat / mpeg.c
index 7c87517a2f5e053e2fd8f1e55265c4c1482a92f2..f63e79f673c7a9589c0aca0c6f3aaca6ef759c12 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * MPEG1/2 demuxer
+ * MPEG-1/2 demuxer
  * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
  *
  * This file is part of Libav.
@@ -23,9 +23,6 @@
 #include "internal.h"
 #include "mpeg.h"
 
-#undef NDEBUG
-#include <assert.h>
-
 /*********************************************/
 /* demux code */
 
@@ -290,7 +287,7 @@ redo:
             goto error_redo;
         c = avio_r8(s->pb);
         len--;
-        /* XXX: for mpeg1, should test only bit 7 */
+        /* XXX: for MPEG-1, should test only bit 7 */
         if (c != 0xff)
             break;
     }
@@ -517,8 +514,8 @@ skip:
     if (!st)
         goto skip;
     st->id                = startcode;
-    st->codec->codec_type = type;
-    st->codec->codec_id   = codec_id;
+    st->codecpar->codec_type = type;
+    st->codecpar->codec_id   = codec_id;
     st->need_parsing      = AVSTREAM_PARSE_FULL;
 
 found:
@@ -530,7 +527,7 @@ found:
     pkt->dts          = dts;
     pkt->pos          = dummy_pos;
     pkt->stream_index = st->index;
-    av_dlog(s, "%d: pts=%0.3f dts=%0.3f size=%d\n",
+    av_log(s, AV_LOG_TRACE, "%d: pts=%0.3f dts=%0.3f size=%d\n",
             pkt->stream_index, pkt->pts / 90000.0, pkt->dts / 90000.0,
             pkt->size);
 
@@ -550,7 +547,7 @@ static int64_t mpegps_read_dts(AVFormatContext *s, int stream_index,
     for (;;) {
         len = mpegps_read_pes_header(s, &pos, &startcode, &pts, &dts);
         if (len < 0) {
-            av_dlog(s, "none (ret=%d)\n", len);
+            av_log(s, AV_LOG_TRACE, "none (ret=%d)\n", len);
             return AV_NOPTS_VALUE;
         }
         if (startcode == s->streams[stream_index]->id &&
@@ -559,7 +556,7 @@ static int64_t mpegps_read_dts(AVFormatContext *s, int stream_index,
         }
         avio_skip(s->pb, len);
     }
-    av_dlog(s, "pos=0x%"PRIx64" dts=0x%"PRIx64" %0.3f\n",
+    av_log(s, AV_LOG_TRACE, "pos=0x%"PRIx64" dts=0x%"PRIx64" %0.3f\n",
             pos, dts, dts / 90000.0);
     *ppos = pos;
     return dts;