diff options
author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2008-06-22 15:52:28 +0000 |
---|---|---|
committer | Aurelien Jacobs <aurel@gnuage.org> | 2008-06-22 15:52:28 +0000 |
commit | 5e8477b011d24fde13e0263901381e971caf31fd (patch) | |
tree | 39d4442d7d65d4c5c01c72e9799cad5974e621dc /libavformat/matroskadec.c | |
parent | 935ec5a1d5841cefa6007d53a8a7e5968f4fb043 (diff) | |
download | ffmpeg-streaming-5e8477b011d24fde13e0263901381e971caf31fd.zip ffmpeg-streaming-5e8477b011d24fde13e0263901381e971caf31fd.tar.gz |
matroskadec: decode track private data if needed
original patch by Evgeniy Stepanov eugeni.stepanov _at_ gmail _dot_ com
Originally committed as revision 13892 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/matroskadec.c')
-rw-r--r-- | libavformat/matroskadec.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index d3777ba..bea76f4 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -1610,6 +1610,23 @@ matroska_add_stream (MatroskaDemuxContext *matroska) } } + if (track->codec_priv_size && track->encoding_scope & 2) { + uint8_t *orig_priv = track->codec_priv; + int offset = matroska_decode_buffer(&track->codec_priv, + &track->codec_priv_size, track); + if (offset > 0) { + track->codec_priv = av_malloc(track->codec_priv_size + offset); + memcpy(track->codec_priv, track->encoding_settings, offset); + memcpy(track->codec_priv+offset, orig_priv, track->codec_priv_size); + track->codec_priv_size += offset; + av_free(orig_priv); + } else if (!offset) { + av_free(orig_priv); + } else + av_log(matroska->ctx, AV_LOG_ERROR, + "Failed to decode codec private data\n"); + } + if (track->type && matroska->num_tracks < ARRAY_SIZE(matroska->tracks)) { matroska->tracks[matroska->num_tracks++] = track; } else { |