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

Originally committed as revision 5961 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Michael Niedermayer 2006-08-08 20:31:19 +00:00
parent 434cab9e0f
commit 494bbf5805
3 changed files with 15 additions and 3 deletions

View File

@ -122,6 +122,7 @@ typedef struct AVFormatParameters {
#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;

View File

@ -423,6 +423,7 @@ AVOutputFormat flac_muxer = {
flac_write_header,
raw_write_packet,
raw_write_trailer,
.flags= AVFMT_NOTIMESTAMPS,
};
#endif //CONFIG_MUXERS
@ -449,6 +450,7 @@ AVOutputFormat ac3_muxer = {
raw_write_header,
raw_write_packet,
raw_write_trailer,
.flags= AVFMT_NOTIMESTAMPS,
};
#endif //CONFIG_MUXERS
@ -498,6 +500,7 @@ AVOutputFormat h261_muxer = {
raw_write_header,
raw_write_packet,
raw_write_trailer,
.flags= AVFMT_NOTIMESTAMPS,
};
#endif //CONFIG_MUXERS
@ -525,6 +528,7 @@ AVOutputFormat h263_muxer = {
raw_write_header,
raw_write_packet,
raw_write_trailer,
.flags= AVFMT_NOTIMESTAMPS,
};
#endif //CONFIG_MUXERS
@ -552,6 +556,7 @@ AVOutputFormat m4v_muxer = {
raw_write_header,
raw_write_packet,
raw_write_trailer,
.flags= AVFMT_NOTIMESTAMPS,
};
#endif //CONFIG_MUXERS
@ -579,6 +584,7 @@ AVOutputFormat h264_muxer = {
raw_write_header,
raw_write_packet,
raw_write_trailer,
.flags= AVFMT_NOTIMESTAMPS,
};
#endif //CONFIG_MUXERS
@ -605,6 +611,7 @@ AVOutputFormat mpeg1video_muxer = {
raw_write_header,
raw_write_packet,
raw_write_trailer,
.flags= AVFMT_NOTIMESTAMPS,
};
#endif //CONFIG_MUXERS
@ -620,6 +627,7 @@ AVOutputFormat mpeg2video_muxer = {
raw_write_header,
raw_write_packet,
raw_write_trailer,
.flags= AVFMT_NOTIMESTAMPS,
};
#endif //CONFIG_MUXERS
@ -659,6 +667,7 @@ AVOutputFormat mjpeg_muxer = {
raw_write_header,
raw_write_packet,
raw_write_trailer,
.flags= AVFMT_NOTIMESTAMPS,
};
#endif //CONFIG_MUXERS
@ -690,6 +699,7 @@ AVOutputFormat pcm_ ## name ## _muxer = {\
raw_write_header,\
raw_write_packet,\
raw_write_trailer,\
.flags= AVFMT_NOTIMESTAMPS,\
};
@ -786,6 +796,7 @@ AVOutputFormat rawvideo_muxer = {
raw_write_header,
raw_write_packet,
raw_write_trailer,
.flags= AVFMT_NOTIMESTAMPS,
};
#endif //CONFIG_MUXERS
@ -810,6 +821,6 @@ AVOutputFormat null_muxer = {
raw_write_header,
null_write_packet,
raw_write_trailer,
.flags = AVFMT_NOFILE | AVFMT_RAWPICTURE,
.flags = AVFMT_NOFILE | AVFMT_RAWPICTURE | AVFMT_NOTIMESTAMPS,
};
#endif //CONFIG_MUXERS

View File

@ -2402,7 +2402,7 @@ int av_write_frame(AVFormatContext *s, AVPacket *pkt)
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 @@ int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt){
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)