summaryrefslogtreecommitdiffstats
path: root/libhb/bd.c
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2018-06-13 15:07:25 -0700
committerJohn Stebbins <[email protected]>2018-06-13 15:07:25 -0700
commitf1714ec672382862b10b3df7e81a0cb0bcaf34af (patch)
tree70c004bd6cea04aad0b248c27b204a0554e5d6fa /libhb/bd.c
parentc85294a8f0bce69d5cb417f60a143663fb83772a (diff)
Fix PGS subtitle decoding...
...And add a timebase to every stream. ffmpeg's subtitle decoder internally converts the packet pts to AV_TIME_BASE units based on AVCodecContext.pkt_timebase. If pkt_timebase is not set, the PGS subtitle decoder only returns AV_NOPTS_VALUE for timestamps. So setting pkt_timebase in decpgssub.c fixes PGS subtitle decoding. Confusingly, the subtitle decoder does not convert the pts *back* to the input timebase, but instead leaves them in AV_TIME_BASE units upon returning a decoded subtitle. To get a head start on fixing any other such issues that might arrise, I have also set pkt_timebase in all other avcodec decoders.
Diffstat (limited to 'libhb/bd.c')
-rw-r--r--libhb/bd.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/libhb/bd.c b/libhb/bd.c
index 4517d2075..b8fc6fc0a 100644
--- a/libhb/bd.c
+++ b/libhb/bd.c
@@ -115,9 +115,11 @@ static void add_subtitle(int track, hb_list_t *list_subtitle, BLURAY_STREAM_INFO
snprintf(subtitle->iso639_2, sizeof( subtitle->iso639_2 ), "%s",
lang->iso639_2);
- subtitle->reg_desc = STR4_TO_UINT32("HDMV");
- subtitle->stream_type = bdsub->coding_type;
- subtitle->codec = codec;
+ subtitle->reg_desc = STR4_TO_UINT32("HDMV");
+ subtitle->stream_type = bdsub->coding_type;
+ subtitle->codec = codec;
+ subtitle->timebase.num = 1;
+ subtitle->timebase.den = 90000;
hb_log( "bd: subtitle id=0x%x, lang=%s, 3cc=%s", subtitle->id,
subtitle->lang, subtitle->iso639_2 );
@@ -202,7 +204,10 @@ static void add_audio(int track, hb_list_t *list_audio, BLURAY_STREAM_INFO *bdau
hb_log("bd: audio id=0x%x, lang=%s (%s), 3cc=%s", audio->id,
audio->config.lang.simple, codec_name, audio->config.lang.iso639_2);
- audio->config.in.track = track;
+ audio->config.in.track = track;
+ audio->config.in.timebase.num = 1;
+ audio->config.in.timebase.den = 90000;
+
hb_list_add( list_audio, audio );
return;
}