]> git.sesse.net Git - ffmpeg/blobdiff - ffmpeg.c
avformat/wavdec: allow data chunk to be before fmt/xma2 chunk
[ffmpeg] / ffmpeg.c
index d3b8c4d8010a6942904f03dd470fd1727bbb486b..7f3c426e099f6f80085df17049e124e633601324 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -671,6 +671,11 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, OutputStream *ost)
             else
                 ost->error[i] = -1;
         }
+
+        if (ost->frame_rate.num) {
+            pkt->duration = av_rescale_q(1, av_inv_q(ost->frame_rate),
+                                         ost->st->time_base);
+        }
     }
 
     if (bsfc)
@@ -2447,6 +2452,9 @@ static void print_sdp(void)
         }
     }
 
+    if (!j)
+        goto fail;
+
     av_sdp_create(avc, j, sdp, sizeof(sdp));
 
     if (!sdp_filename) {
@@ -2462,6 +2470,7 @@ static void print_sdp(void)
         }
     }
 
+fail:
     av_freep(&avc);
 }