demux_mkv: fix realaudio timestamps

This fixes the sample RA_missing_timestamps.mkv. Pretty funny how this
code got it almost right, but not quite, so it was broken all these
years. And then, after everyone stopped caring, someone comes and fixes
it. (By the way, I know absolutely nothing about realaudio.)
This commit is contained in:
wm4 2013-07-20 02:16:46 +02:00
parent 3dc063a330
commit 67bad55414
1 changed files with 2 additions and 2 deletions

View File

@ -2044,7 +2044,7 @@ static void handle_realaudio(demuxer_t *demuxer, mkv_track_t *track,
apk_usize); apk_usize);
/* Put timestamp only on packets that correspond to original /* Put timestamp only on packets that correspond to original
* audio packets in file */ * audio packets in file */
dp->pts = (x * apk_usize % w) ? 0 : dp->pts = (x * apk_usize % w) ? MP_NOPTS_VALUE :
track->audio_timestamp[x * apk_usize / w]; track->audio_timestamp[x * apk_usize / w];
dp->pos = track->audio_filepos; // all equal dp->pos = track->audio_filepos; // all equal
dp->keyframe = !x; // Mark first packet as keyframe dp->keyframe = !x; // Mark first packet as keyframe
@ -2054,7 +2054,7 @@ static void handle_realaudio(demuxer_t *demuxer, mkv_track_t *track,
} else { // Not a codec that requires reordering } else { // Not a codec that requires reordering
dp = new_demux_packet_from(buffer, size); dp = new_demux_packet_from(buffer, size);
if (track->ra_pts == mkv_d->last_pts && !mkv_d->a_skip_to_keyframe) if (track->ra_pts == mkv_d->last_pts && !mkv_d->a_skip_to_keyframe)
dp->pts = 0; dp->pts = MP_NOPTS_VALUE;
else else
dp->pts = mkv_d->last_pts; dp->pts = mkv_d->last_pts;
track->ra_pts = mkv_d->last_pts; track->ra_pts = mkv_d->last_pts;