aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2004-12-14 20:01:49 +0000
committerMichael Niedermayer <michaelni@gmx.at>2004-12-14 20:01:49 +0000
commit2fef0bdfc120a70c06c8620af6e1d11a11ef7201 (patch)
treecdc0c12bf337aba3684ebe8de18cf4266fe30023
parent5edea431d0616737e5a5f58cefc07ba5b2e0875f (diff)
downloadffmpeg-2fef0bdfc120a70c06c8620af6e1d11a11ef7201.tar.gz
try to set next_pts to a reasonable value in case of streamcopy
Originally committed as revision 3753 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--ffmpeg.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index bfc2c6a5c1..abf90ef6a5 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1175,6 +1175,19 @@ static int output_packet(AVInputStream *ist, int ist_index,
goto fail_decode;
}
} else {
+ switch(ist->st->codec.codec_type) {
+ case CODEC_TYPE_AUDIO:
+ ist->next_pts += ((int64_t)AV_TIME_BASE * ist->st->codec.frame_size) /
+ (ist->st->codec.sample_rate * ist->st->codec.channels);
+ break;
+ case CODEC_TYPE_VIDEO:
+ if (ist->st->codec.frame_rate_base != 0) {
+ ist->next_pts += ((int64_t)AV_TIME_BASE *
+ ist->st->codec.frame_rate_base) /
+ ist->st->codec.frame_rate;
+ }
+ break;
+ }
data_buf = ptr;
data_size = len;
ret = len;