[Ffmpeg-cvslog] r5961 - in trunk/libavformat: avformat.h raw.c utils.c

michael subversion
Tue Aug 8 22:31:19 CEST 2006


Author: michael
Date: Tue Aug  8 22:31:19 2006
New Revision: 5961

Modified:
   trunk/libavformat/avformat.h
   trunk/libavformat/raw.c
   trunk/libavformat/utils.c

Log:
dont be too picky about timestampsbeing wrong if the destination container is without timestamps and raw of the raw video / raw audio sort


Modified: trunk/libavformat/avformat.h
==============================================================================
--- trunk/libavformat/avformat.h	(original)
+++ trunk/libavformat/avformat.h	Tue Aug  8 22:31:19 2006
@@ -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;

Modified: trunk/libavformat/raw.c
==============================================================================
--- trunk/libavformat/raw.c	(original)
+++ trunk/libavformat/raw.c	Tue Aug  8 22:31:19 2006
@@ -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

Modified: trunk/libavformat/utils.c
==============================================================================
--- trunk/libavformat/utils.c	(original)
+++ trunk/libavformat/utils.c	Tue Aug  8 22:31:19 2006
@@ -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)




More information about the ffmpeg-cvslog mailing list