mirror of
https://projects.vdr-developer.org/git/vdr-plugin-softhddevice.git
synced 2023-10-10 19:16:51 +02:00
Add automatic frame rate detection for older ffmpeg versions.
This commit is contained in:
parent
2866e328c6
commit
28555643a5
@ -1,6 +1,7 @@
|
|||||||
User johns
|
User johns
|
||||||
Date:
|
Date:
|
||||||
|
|
||||||
|
Add automatic frame rate detection for older ffmpeg versions.
|
||||||
Fix bug: destroyed vdpau surfaces still used in queue.
|
Fix bug: destroyed vdpau surfaces still used in queue.
|
||||||
Fix bug: need signed char, if compiler has unsigned chars.
|
Fix bug: need signed char, if compiler has unsigned chars.
|
||||||
Try smaller audio puffer, if default size fails.
|
Try smaller audio puffer, if default size fails.
|
||||||
|
12
video.c
12
video.c
@ -457,10 +457,18 @@ static void VideoSetPts(int64_t * pts_p, int interlaced,
|
|||||||
// FIXME: using framerate as workaround for av_frame_get_pkt_duration
|
// FIXME: using framerate as workaround for av_frame_get_pkt_duration
|
||||||
//
|
//
|
||||||
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(56,13,100)
|
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(56,13,100)
|
||||||
// FIXME: need frame rate for older versions
|
// version for older ffmpeg without framerate
|
||||||
|
if (video_ctx->time_base.num && video_ctx->time_base.den) {
|
||||||
|
duration =
|
||||||
|
(video_ctx->ticks_per_frame * 1000 * video_ctx->time_base.num) /
|
||||||
|
video_ctx->time_base.den;
|
||||||
|
} else {
|
||||||
duration = interlaced ? 40 : 20; // 50Hz -> 20ms default
|
duration = interlaced ? 40 : 20; // 50Hz -> 20ms default
|
||||||
|
}
|
||||||
|
Debug(4, "video: %d/%d %" PRIx64 " -> %d\n", video_ctx->time_base.den,
|
||||||
|
video_ctx->time_base.num, av_frame_get_pkt_duration(frame), duration);
|
||||||
#else
|
#else
|
||||||
if (video_ctx->framerate.num != 0 && video_ctx->framerate.den != 0) {
|
if (video_ctx->framerate.num && video_ctx->framerate.den) {
|
||||||
duration = 1000 * video_ctx->framerate.den / video_ctx->framerate.num;
|
duration = 1000 * video_ctx->framerate.den / video_ctx->framerate.num;
|
||||||
} else {
|
} else {
|
||||||
duration = interlaced ? 40 : 20; // 50Hz -> 20ms default
|
duration = interlaced ? 40 : 20; // 50Hz -> 20ms default
|
||||||
|
Loading…
Reference in New Issue
Block a user