aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2004-04-04 14:39:20 +0000
committerMichael Niedermayer <michaelni@gmx.at>2004-04-04 14:39:20 +0000
commit6d8f985ecfb1cab04dc114307091282db6f16933 (patch)
tree1746d6c8ea874ee4a6ed565d38ce1a58b0adb893 /libavformat/utils.c
parent7d1bbcd42fdb990dae849a1019e6b53cfe54a815 (diff)
downloadffmpeg-6d8f985ecfb1cab04dc114307091282db6f16933.tar.gz
fix obnoxious ogg_packet passing from encoder to muxer
Originally committed as revision 2955 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index c170c03577..14f965d697 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -1707,7 +1707,11 @@ int av_write_frame(AVFormatContext *s, int stream_index, const uint8_t *buf,
switch (st->codec.codec_type) {
case CODEC_TYPE_AUDIO:
frame_size = get_audio_frame_size(&st->codec, size);
- if (frame_size >= 0) {
+
+ /* note, we skip the initial 0-size packets as they are most likely equal to the encoder delay,
+ but it would be better if we had the real timestamps from the encoder */
+// av_log(s, AV_LOG_DEBUG, "%d %lld %lld\n", size, st->pts.num, st->pts.val);
+ if (frame_size >= 0 && (size || st->pts.num!=st->pts.den>>1 || st->pts.val)) {
av_frac_add(&st->pts,
(int64_t)s->pts_den * frame_size);
}
@@ -1900,6 +1904,8 @@ int64_t parse_date(const char *datestr, int duration)
const char *q;
int is_utc, len;
char lastch;
+
+#undef time
time_t now = time(0);
len = strlen(datestr);