1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-18 12:55:16 +00:00
mpv/sub
wm4 8a84da8102 av_common: add timebase parameter to mp_set_av_packet()
If the timebase is set, it's used for converting the packet timestamps.
Otherwise, the previous method of reinterpret-casting the mpv style
double timestamps to libavcodec style int64_t timestamps is used.

Also replace the kind of awkward mp_get_av_frame_pkt_ts() function by
mp_pts_from_av(), which simply converts timestamps in a way the old
function did. (Plus it takes a timebase parameter, similar to the
addition to mp_set_av_packet().)

Note that this should not change anything yet. The code in ad_lavc.c and
vd_lavc.c passes NULL for the timebase parameters. We could set
AVCodecContext.pkt_timebase and use that if we want to give libavcodec
"proper" timestamps.

This could be important for ad_lavc.c: some codecs (opus, probably mp3
and aac too) have weird requirements about doing decoding preroll on the
container level, and thus require adjusting the audio start timestamps
in some cases. libavcodec doesn't tell us how much was skipped, so we
either get shifted timestamps (by the length of the skipped data), or we
give it proper timestamps. (Note: libavcodec interprets or changes
timestamps only if pkt_timebase is set, which by default it is not.)
This would require selecting a timebase though, so I feel uncomfortable
with the idea. At least this change paves the way, and will allow some
testing.
2013-12-04 23:12:51 +01:00
..
ass_mp.c Rename sub.c/.h to osd.c/.h 2013-11-24 14:44:58 +01:00
ass_mp.h configure: uniform the defines to #define HAVE_xxx (0|1) 2013-11-03 21:59:54 +01:00
dec_sub.c Rename sub.c/.h to osd.c/.h 2013-11-24 14:44:58 +01:00
dec_sub.h Rename sub.c/.h to osd.c/.h 2013-11-24 14:44:58 +01:00
draw_bmp.c Rename sub.c/.h to osd.c/.h 2013-11-24 14:44:58 +01:00
draw_bmp.h Rename sub.c/.h to osd.c/.h 2013-11-24 14:44:58 +01:00
find_subfiles.c sub: respect detected language for fuzzy-matched external subtitles 2013-11-25 23:41:02 +01:00
find_subfiles.h sub: respect detected language for fuzzy-matched external subtitles 2013-11-25 23:41:02 +01:00
img_convert.c Rename sub.c/.h to osd.c/.h 2013-11-24 14:44:58 +01:00
img_convert.h Revert "sub: support straight alpha additionally to premultiplied alpha" 2013-08-12 02:49:22 +02:00
osd_dummy.c Rename sub.c/.h to osd.c/.h 2013-11-24 14:44:58 +01:00
osd_font.otf osc: rename osd_font, add some glyphs 2013-09-08 03:35:04 +02:00
osd_libass.c Rename sub.c/.h to osd.c/.h 2013-11-24 14:44:58 +01:00
osd.c osd: remove mp_osd_res.video_par field 2013-11-24 14:44:58 +01:00
osd.h osd: remove mp_osd_res.video_par field 2013-11-24 14:44:58 +01:00
sd_ass.c Rename sub.c/.h to osd.c/.h 2013-11-24 14:44:58 +01:00
sd_lavc_conv.c av_common: add timebase parameter to mp_set_av_packet() 2013-12-04 23:12:51 +01:00
sd_lavc.c Rename sub.c/.h to osd.c/.h 2013-11-24 14:44:58 +01:00
sd_lavf_srt.c core: move contents to mpvcore (2/2) 2013-08-06 22:52:31 +02:00
sd_microdvd.c core: move contents to mpvcore (2/2) 2013-08-06 22:52:31 +02:00
sd_movtext.c sd_ass: disable special handling of subtitles with duration 0 2013-06-25 00:11:54 +02:00
sd_spu.c Rename sub.c/.h to osd.c/.h 2013-11-24 14:44:58 +01:00
sd_srt.c core: move contents to mpvcore (2/2) 2013-08-06 22:52:31 +02:00
sd.h demux: rename demux_packet.h to packet.h 2013-11-18 18:46:44 +01:00
spudec.c Rename sub.c/.h to osd.c/.h 2013-11-24 14:44:58 +01:00
spudec.h sd_lavc, sd_spu: make dvdsub stretching conditional on --stretch-dvd-subs. 2013-11-07 12:56:07 +01:00