Skip to content

Commit

Permalink
lavf/xwma: Support wmapro.
Browse files Browse the repository at this point in the history
Fixes ticket #4963.
  • Loading branch information
cehoyos committed Oct 25, 2015
1 parent 65ffca9 commit 6498b34
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion libavformat/xwma.c
Expand Up @@ -85,7 +85,8 @@ static int xwma_read_header(AVFormatContext *s)
* extradata for that. Thus, ask the user for feedback, but try to go on
* anyway.
*/
if (st->codec->codec_id != AV_CODEC_ID_WMAV2) {
if (st->codec->codec_id != AV_CODEC_ID_WMAV2 &&
st->codec->codec_id != AV_CODEC_ID_WMAPRO) {
avpriv_request_sample(s, "Unexpected codec (tag 0x04%x; id %d)",
st->codec->codec_tag, st->codec->codec_id);
} else {
Expand All @@ -103,6 +104,13 @@ static int xwma_read_header(AVFormatContext *s)
*/
avpriv_request_sample(s, "Unexpected extradata (%d bytes)",
st->codec->extradata_size);
} else if (st->codec->codec_id == AV_CODEC_ID_WMAPRO) {
if (ff_alloc_extradata(st->codec, 18))
return AVERROR(ENOMEM);

memset(st->codec->extradata, 0, st->codec->extradata_size);
st->codec->extradata[ 0] = st->codec->bits_per_coded_sample;
st->codec->extradata[14] = 224;
} else {
if (ff_alloc_extradata(st->codec, 6))
return AVERROR(ENOMEM);
Expand Down

0 comments on commit 6498b34

Please sign in to comment.