]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/utils.c
Move 2 defines from mpegaudiodec.c to mpegaudiodata.h to allow compilation
[ffmpeg] / libavformat / utils.c
index d1480a24545067f35909c4c6b87d3c7cd6b40245..c91102c6ce9ea12cb0b56b9352eadb67c90f80ee 100644 (file)
@@ -647,9 +647,6 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
             pkt->dts += offset;
     }
 
-    if(is_intra_only(st->codec))
-        pkt->flags |= PKT_FLAG_KEY;
-
     /* do we have a video B frame ? */
     delay= st->codec->has_b_frames;
     presentation_delayed = 0;
@@ -726,7 +723,9 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
 //    av_log(NULL, AV_LOG_ERROR, "OUTdelayed:%d/%d pts:%"PRId64", dts:%"PRId64" cur_dts:%"PRId64"\n", presentation_delayed, delay, pkt->pts, pkt->dts, st->cur_dts);
 
     /* update flags */
-    if (pc) {
+    if(is_intra_only(st->codec))
+        pkt->flags |= PKT_FLAG_KEY;
+    else if (pc) {
         pkt->flags = 0;
         /* key frame computation */
             if (pc->pict_type == FF_I_TYPE)
@@ -2508,8 +2507,9 @@ void av_program_add_stream_index(AVFormatContext *ac, int progid, unsigned int i
 }
 
 /* "user interface" functions */
-static void dump_stream_format(AVFormatContext *ic, int i, int index, char *buf, int is_output)
+static void dump_stream_format(AVFormatContext *ic, int i, int index, int is_output)
 {
+    char buf[256];
     int flags = (is_output ? ic->oformat->flags : ic->iformat->flags);
     AVStream *st = ic->streams[i];
     int g = ff_gcd(st->time_base.num, st->time_base.den);
@@ -2539,8 +2539,7 @@ void dump_format(AVFormatContext *ic,
                  const char *url,
                  int is_output)
 {
-    int i, flags;
-    char buf[256];
+    int i;
 
     av_log(NULL, AV_LOG_INFO, "%s #%d, %s, %s '%s':\n",
             is_output ? "Output" : "Input",
@@ -2581,15 +2580,14 @@ void dump_format(AVFormatContext *ic,
     if(ic->nb_programs) {
         int j, k;
         for(j=0; j<ic->nb_programs; j++) {
-            av_log(NULL, AV_LOG_INFO, "  Program %d", ic->programs[j]->id);
-            if(ic->programs[j]->name)
-                av_log(NULL, AV_LOG_INFO, " \"%s\"\n", ic->programs[j]->name);
+            av_log(NULL, AV_LOG_INFO, "  Program %d %s\n", ic->programs[j]->id,
+                   ic->programs[j]->name ? ic->programs[j]->name : "");
             for(k=0; k<ic->programs[j]->nb_stream_indexes; k++)
-                dump_stream_format(ic, ic->programs[j]->stream_index[k], index, buf, is_output);
+                dump_stream_format(ic, ic->programs[j]->stream_index[k], index, is_output);
          }
     } else
     for(i=0;i<ic->nb_streams;i++)
-        dump_stream_format(ic, i, index, buf, is_output);
+        dump_stream_format(ic, i, index, is_output);
 }
 
 int parse_image_size(int *width_ptr, int *height_ptr, const char *str)