changeset 1245:e59b75051ded libavformat

dont be too picky about timestampsbeing wrong if the destination container is without timestamps and raw of the raw video / raw audio sort
author michael
date Tue, 08 Aug 2006 20:31:19 +0000
parents 1a14fff172ca
children ca6fc8c8c9dc
files avformat.h raw.c utils.c
diffstat 3 files changed, 15 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/avformat.h	Tue Aug 08 19:55:32 2006 +0000
+++ b/avformat.h	Tue Aug 08 20:31:19 2006 +0000
@@ -122,6 +122,7 @@
 #define AVFMT_RAWPICTURE    0x0020 /* format wants AVPicture structure for
                                       raw picture data */
 #define AVFMT_GLOBALHEADER  0x0040 /* format wants global header */
+#define AVFMT_NOTIMESTAMPS  0x0080 /* format doesnt need / has any timestamps */
 
 typedef struct AVOutputFormat {
     const char *name;
--- a/raw.c	Tue Aug 08 19:55:32 2006 +0000
+++ b/raw.c	Tue Aug 08 20:31:19 2006 +0000
@@ -423,6 +423,7 @@
     flac_write_header,
     raw_write_packet,
     raw_write_trailer,
+    .flags= AVFMT_NOTIMESTAMPS,
 };
 #endif //CONFIG_MUXERS
 
@@ -449,6 +450,7 @@
     raw_write_header,
     raw_write_packet,
     raw_write_trailer,
+    .flags= AVFMT_NOTIMESTAMPS,
 };
 #endif //CONFIG_MUXERS
 
@@ -498,6 +500,7 @@
     raw_write_header,
     raw_write_packet,
     raw_write_trailer,
+    .flags= AVFMT_NOTIMESTAMPS,
 };
 #endif //CONFIG_MUXERS
 
@@ -525,6 +528,7 @@
     raw_write_header,
     raw_write_packet,
     raw_write_trailer,
+    .flags= AVFMT_NOTIMESTAMPS,
 };
 #endif //CONFIG_MUXERS
 
@@ -552,6 +556,7 @@
     raw_write_header,
     raw_write_packet,
     raw_write_trailer,
+    .flags= AVFMT_NOTIMESTAMPS,
 };
 #endif //CONFIG_MUXERS
 
@@ -579,6 +584,7 @@
     raw_write_header,
     raw_write_packet,
     raw_write_trailer,
+    .flags= AVFMT_NOTIMESTAMPS,
 };
 #endif //CONFIG_MUXERS
 
@@ -605,6 +611,7 @@
     raw_write_header,
     raw_write_packet,
     raw_write_trailer,
+    .flags= AVFMT_NOTIMESTAMPS,
 };
 #endif //CONFIG_MUXERS
 
@@ -620,6 +627,7 @@
     raw_write_header,
     raw_write_packet,
     raw_write_trailer,
+    .flags= AVFMT_NOTIMESTAMPS,
 };
 #endif //CONFIG_MUXERS
 
@@ -659,6 +667,7 @@
     raw_write_header,
     raw_write_packet,
     raw_write_trailer,
+    .flags= AVFMT_NOTIMESTAMPS,
 };
 #endif //CONFIG_MUXERS
 
@@ -690,6 +699,7 @@
     raw_write_header,\
     raw_write_packet,\
     raw_write_trailer,\
+    .flags= AVFMT_NOTIMESTAMPS,\
 };
 
 
@@ -786,6 +796,7 @@
     raw_write_header,
     raw_write_packet,
     raw_write_trailer,
+    .flags= AVFMT_NOTIMESTAMPS,
 };
 #endif //CONFIG_MUXERS
 
@@ -810,6 +821,6 @@
     raw_write_header,
     null_write_packet,
     raw_write_trailer,
-    .flags = AVFMT_NOFILE | AVFMT_RAWPICTURE,
+    .flags = AVFMT_NOFILE | AVFMT_RAWPICTURE | AVFMT_NOTIMESTAMPS,
 };
 #endif //CONFIG_MUXERS
--- a/utils.c	Tue Aug 08 19:55:32 2006 +0000
+++ b/utils.c	Tue Aug 08 20:31:19 2006 +0000
@@ -2402,7 +2402,7 @@
     int ret;
 
     ret=compute_pkt_fields2(s->streams[pkt->stream_index], pkt);
-    if(ret<0)
+    if(ret<0 && !(s->oformat->flags & AVFMT_NOTIMESTAMPS))
         return ret;
 
     truncate_ts(s->streams[pkt->stream_index], pkt);
@@ -2509,7 +2509,7 @@
         return 0;
 
 //av_log(NULL, AV_LOG_DEBUG, "av_interleaved_write_frame %d %Ld %Ld\n", pkt->size, pkt->dts, pkt->pts);
-    if(compute_pkt_fields2(st, pkt) < 0)
+    if(compute_pkt_fields2(st, pkt) < 0 && !(s->oformat->flags & AVFMT_NOTIMESTAMPS))
         return -1;
 
     if(pkt->dts == AV_NOPTS_VALUE)