mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-08 13:22:53 +02:00
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
This commit is contained in:
parent
5edea431d0
commit
2fef0bdfc1
13
ffmpeg.c
13
ffmpeg.c
@ -1175,6 +1175,19 @@ static int output_packet(AVInputStream *ist, int ist_index,
|
|||||||
goto fail_decode;
|
goto fail_decode;
|
||||||
}
|
}
|
||||||
} else {
|
} 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_buf = ptr;
|
||||||
data_size = len;
|
data_size = len;
|
||||||
ret = len;
|
ret = len;
|
||||||
|
Loading…
Reference in New Issue
Block a user