summaryrefslogtreecommitdiffstats
path: root/libhb/common.h
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/common.h
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/common.h')
-rw-r--r--libhb/common.h95
1 files changed, 49 insertions, 46 deletions
diff --git a/libhb/common.h b/libhb/common.h
index b1f457d05..a91d608c9 100644
--- a/libhb/common.h
+++ b/libhb/common.h
@@ -813,6 +813,7 @@ struct hb_audio_config_s
PRIVATE int encoder_delay; /* Encoder delay in samples.
* These samples should be dropped
* when decoding */
+ PRIVATE hb_rational_t timebase;
} in;
struct
@@ -943,14 +944,15 @@ struct hb_subtitle_s
#ifdef __LIBHB__
/* Internal data */
- PRIVATE uint32_t codec; /* Input "codec" */
- PRIVATE uint32_t reg_desc; /* registration descriptor of source */
- PRIVATE uint32_t stream_type; /* stream type from source stream */
- PRIVATE uint32_t substream_type;/* substream for multiplexed streams */
-
- hb_fifo_t * fifo_in; /* SPU ES */
- hb_fifo_t * fifo_raw; /* Decoded SPU */
- hb_fifo_t * fifo_out; /* Correct Timestamps, ready to be muxed */
+ uint32_t codec; /* Input "codec" */
+ uint32_t reg_desc; /* registration descriptor of source */
+ uint32_t stream_type; /* stream type from source stream */
+ uint32_t substream_type; /* substream for multiplexed streams */
+ hb_rational_t timebase;
+
+ hb_fifo_t * fifo_in; /* SPU ES */
+ hb_fifo_t * fifo_raw; /* Decoded SPU */
+ hb_fifo_t * fifo_out; /* Correct Timestamps, ready to be muxed */
hb_mux_data_t * mux_data;
#endif
};
@@ -1000,51 +1002,52 @@ struct hb_metadata_s
struct hb_title_s
{
enum { HB_DVD_TYPE, HB_BD_TYPE, HB_STREAM_TYPE, HB_FF_STREAM_TYPE } type;
- uint32_t reg_desc;
- char path[1024];
- char name[1024];
- int index;
- int playlist;
- int vts;
- int ttn;
- int cell_start;
- int cell_end;
- uint64_t block_start;
- uint64_t block_end;
- uint64_t block_count;
- int angle_count;
- void * opaque_priv;
+ uint32_t reg_desc;
+ char path[1024];
+ char name[1024];
+ int index;
+ int playlist;
+ int vts;
+ int ttn;
+ int cell_start;
+ int cell_end;
+ uint64_t block_start;
+ uint64_t block_end;
+ uint64_t block_count;
+ int angle_count;
+ void * opaque_priv;
/* Visual-friendly duration */
- int hours;
- int minutes;
- int seconds;
+ int hours;
+ int minutes;
+ int seconds;
/* Exact duration (in 1/90000s) */
- uint64_t duration;
+ uint64_t duration;
- int preview_count;
- int has_resolution_change;
+ int preview_count;
+ int has_resolution_change;
enum { HB_ROTATION_0, HB_ROTATION_90, HB_ROTATION_180, HB_ROTATION_270 } rotation;
- hb_geometry_t geometry;
- hb_rational_t dar; // aspect ratio for the title's video
- hb_rational_t container_dar; // aspect ratio from container (0 if none)
- int color_prim;
- int color_transfer;
- int color_matrix;
- hb_rational_t vrate;
- int crop[4];
+ hb_geometry_t geometry;
+ hb_rational_t dar; // aspect ratio for the title's video
+ hb_rational_t container_dar; // aspect ratio from container (0 if none)
+ int color_prim;
+ int color_transfer;
+ int color_matrix;
+ hb_rational_t vrate;
+ int crop[4];
enum {HB_DVD_DEMUXER, HB_TS_DEMUXER, HB_PS_DEMUXER, HB_NULL_DEMUXER} demuxer;
- int detected_interlacing;
- int pcr_pid; /* PCR PID for TS streams */
- int video_id; /* demuxer stream id for video */
- int video_codec; /* worker object id of video codec */
- uint32_t video_stream_type; /* stream type from source stream */
- int video_codec_param; /* codec specific config */
- char * video_codec_name;
- int video_bitrate;
- char * container_name;
- int data_rate;
+ int detected_interlacing;
+ int pcr_pid; /* PCR PID for TS streams */
+ int video_id; /* demuxer stream id for video */
+ int video_codec; /* worker object id of video codec */
+ uint32_t video_stream_type; /* stream type from source stream */
+ int video_codec_param; /* codec specific config */
+ char * video_codec_name;
+ int video_bitrate;
+ hb_rational_t video_timebase;
+ char * container_name;
+ int data_rate;
// additional supported video decoders (e.g. HW-accelerated implementations)
int video_decode_support;