Mercurial > mplayer.hg
changeset 25651:3d5fb36693ac
Factorize private data decoding for subtitle tracks in mkv demuxer.
author | eugeni |
---|---|
date | Fri, 11 Jan 2008 21:45:08 +0000 |
parents | da94a5973768 |
children | 6e25dda14b62 |
files | libmpdemux/demux_mkv.c |
diffstat | 1 files changed, 12 insertions(+), 20 deletions(-) [+] |
line wrap: on
line diff
--- a/libmpdemux/demux_mkv.c Fri Jan 11 20:55:08 2008 +0000 +++ b/libmpdemux/demux_mkv.c Fri Jan 11 21:45:08 2008 +0000 @@ -2236,8 +2236,7 @@ { mkv_demuxer_t *mkv_d = (mkv_demuxer_t *) demuxer->priv; mkv_track_t *track; - int i, m, size; - uint8_t *buffer; + int i; for (i = 0; i < mkv_d->num_tracks; i++) { @@ -2246,14 +2245,6 @@ (track->subtitle_type != MATROSKA_SUBTYPE_VOBSUB)) continue; - size = track->private_size; - m = demux_mkv_decode (track,track->private_data,&buffer,&size,2); - if (buffer && m) - { - free (track->private_data); - track->private_data = buffer; - track->private_size = size; - } if (!demux_mkv_parse_idx (track)) { free (track->private_data); @@ -2277,8 +2268,7 @@ { mkv_demuxer_t *mkv_d = (mkv_demuxer_t *) demuxer->priv; mkv_track_t *track; - int i, m, size; - uint8_t *buffer; + int i; for (i = 0; i < mkv_d->num_tracks; i++) { @@ -2290,14 +2280,6 @@ if (track->subtitle_type == MATROSKA_SUBTYPE_SSA) { track->sh_sub->ass_track = ass_new_track(ass_library); - size = track->private_size; - m = demux_mkv_decode (track,track->private_data,&buffer,&size,2); - if (buffer && m) - { - free (track->private_data); - track->private_data = buffer; - track->private_size = size; - } ass_process_codec_private(track->sh_sub->ass_track, track->private_data, track->private_size); } } @@ -2309,6 +2291,8 @@ { if (track->subtitle_type != MATROSKA_SUBTYPE_UNKNOWN) { + int size, m; + uint8_t *buffer; sh_sub_t *sh = new_sh_sub_sid(demuxer, track->tnum, sid); track->sh_sub = sh; sh->type = 't'; @@ -2316,6 +2300,14 @@ sh->type = 'v'; if (track->subtitle_type == MATROSKA_SUBTYPE_SSA) sh->type = 'a'; + size = track->private_size; + m = demux_mkv_decode (track,track->private_data,&buffer,&size,2); + if (buffer && m) + { + free (track->private_data); + track->private_data = buffer; + track->private_size = size; + } } else {