| OLD | NEW |
| 1 diff -rpu -N orig/libavformat/matroskadec.c ffmpeg-mt/libavformat/matroskadec.c | 1 diff -wurp -N orig/libavformat/matroskadec.c ffmpeg-mt/libavformat/matroskadec.c |
| 2 --- orig/libavformat/matroskadec.c» 2010-10-11 16:55:30 -0700 | 2 --- orig/libavformat/matroskadec.c» 2010-11-04 08:08:48 -0700 |
| 3 +++ ffmpeg-mt/libavformat/matroskadec.c»2010-10-11 16:55:31 -0700 | 3 +++ ffmpeg-mt/libavformat/matroskadec.c»2010-11-04 08:08:52 -0700 |
| 4 @@ -34,13 +34,17 @@ | 4 @@ -34,13 +34,17 @@ |
| 5 /* For ff_codec_get_id(). */ | 5 /* For ff_codec_get_id(). */ |
| 6 #include "riff.h" | 6 #include "riff.h" |
| 7 #include "isom.h" | 7 #include "isom.h" |
| 8 +#if CONFIG_SIPR_DECODER | 8 +#if CONFIG_SIPR_DECODER |
| 9 #include "rm.h" | 9 #include "rm.h" |
| 10 +#endif | 10 +#endif |
| 11 #include "matroska.h" | 11 #include "matroska.h" |
| 12 #include "libavcodec/mpeg4audio.h" | 12 #include "libavcodec/mpeg4audio.h" |
| 13 #include "libavutil/intfloat_readwrite.h" | 13 #include "libavutil/intfloat_readwrite.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 do { | 61 do { |
| 62 olen = pkt_size *= 3; | 62 olen = pkt_size *= 3; |
| 63 @@ -930,6 +940,7 @@ static int matroska_decode_buffer(uint8_ | 63 @@ -930,6 +940,7 @@ static int matroska_decode_buffer(uint8_ |
| 64 goto failed; | 64 goto failed; |
| 65 pkt_size -= olen; | 65 pkt_size -= olen; |
| 66 break; | 66 break; |
| 67 +#endif | 67 +#endif |
| 68 #if CONFIG_ZLIB | 68 #if CONFIG_ZLIB |
| 69 case MATROSKA_TRACK_ENCODING_COMP_ZLIB: { | 69 case MATROSKA_TRACK_ENCODING_COMP_ZLIB: { |
| 70 z_stream zstream = {0}; | 70 z_stream zstream = {0}; |
| 71 @@ -1190,6 +1201,7 @@ static int matroska_read_header(AVFormat | 71 @@ -1191,6 +1202,7 @@ static int matroska_read_header(AVFormat |
| 72 ebml_free(ebml_syntax, &ebml); | 72 ebml_free(ebml_syntax, &ebml); |
| 73 return AVERROR_PATCHWELCOME; | 73 return AVERROR_PATCHWELCOME; |
| 74 } | 74 } |
| 75 + av_metadata_set2(&s->metadata, "doctype", ebml.doctype, 0); | 75 + av_metadata_set2(&s->metadata, "doctype", ebml.doctype, 0); |
| 76 for (i = 0; i < FF_ARRAY_ELEMS(matroska_doctypes); i++) | 76 for (i = 0; i < FF_ARRAY_ELEMS(matroska_doctypes); i++) |
| 77 if (!strcmp(ebml.doctype, matroska_doctypes[i])) | 77 if (!strcmp(ebml.doctype, matroska_doctypes[i])) |
| 78 break; | 78 break; |
| 79 @@ -1249,14 +1261,17 @@ static int matroska_read_header(AVFormat | 79 @@ -1250,14 +1262,17 @@ static int matroska_read_header(AVFormat |
| 80 "Multiple combined encodings no supported"); | 80 "Multiple combined encodings no supported"); |
| 81 } else if (encodings_list->nb_elem == 1) { | 81 } else if (encodings_list->nb_elem == 1) { |
| 82 if (encodings[0].type || | 82 if (encodings[0].type || |
| 83 - (encodings[0].compression.algo != MATROSKA_TRACK_ENCODING_COMP_
HEADERSTRIP && | 83 - (encodings[0].compression.algo != MATROSKA_TRACK_ENCODING_COMP_
HEADERSTRIP && |
| 84 + (encodings[0].compression.algo != MATROSKA_TRACK_ENCODING_COMP_
HEADERSTRIP | 84 + (encodings[0].compression.algo != MATROSKA_TRACK_ENCODING_COMP_
HEADERSTRIP |
| 85 #if CONFIG_ZLIB | 85 #if CONFIG_ZLIB |
| 86 - encodings[0].compression.algo != MATROSKA_TRACK_ENCODING_COMP_
ZLIB && | 86 - encodings[0].compression.algo != MATROSKA_TRACK_ENCODING_COMP_
ZLIB && |
| 87 + && encodings[0].compression.algo != MATROSKA_TRACK_ENCODING_CO
MP_ZLIB | 87 + && encodings[0].compression.algo != MATROSKA_TRACK_ENCODING_CO
MP_ZLIB |
| 88 #endif | 88 #endif |
| 89 #if CONFIG_BZLIB | 89 #if CONFIG_BZLIB |
| 90 - encodings[0].compression.algo != MATROSKA_TRACK_ENCODING_COMP_
BZLIB && | 90 - encodings[0].compression.algo != MATROSKA_TRACK_ENCODING_COMP_
BZLIB && |
| 91 + && encodings[0].compression.algo != MATROSKA_TRACK_ENCODING_CO
MP_BZLIB | 91 + && encodings[0].compression.algo != MATROSKA_TRACK_ENCODING_CO
MP_BZLIB |
| 92 #endif | 92 #endif |
| 93 - encodings[0].compression.algo != MATROSKA_TRACK_ENCODING_COMP_
LZO)) { | 93 - encodings[0].compression.algo != MATROSKA_TRACK_ENCODING_COMP_
LZO)) { |
| 94 +#if HAVE_LZO1X_999_COMPRESS | 94 +#if HAVE_LZO1X_999_COMPRESS |
| 95 + && encodings[0].compression.algo != MATROSKA_TRACK_ENCODING_CO
MP_LZO | 95 + && encodings[0].compression.algo != MATROSKA_TRACK_ENCODING_CO
MP_LZO |
| 96 +#endif | 96 +#endif |
| 97 + )) { | 97 + )) { |
| 98 encodings[0].scope = 0; | 98 encodings[0].scope = 0; |
| 99 av_log(matroska->ctx, AV_LOG_ERROR, | 99 av_log(matroska->ctx, AV_LOG_ERROR, |
| 100 "Unsupported encoding type"); | 100 "Unsupported encoding type"); |
| 101 @@ -1381,11 +1396,13 @@ static int matroska_read_header(AVFormat | 101 @@ -1382,11 +1397,13 @@ static int matroska_read_header(AVFormat |
| 102 st->codec->block_align = track->audio.coded_framesize; | 102 st->codec->block_align = track->audio.coded_framesize; |
| 103 track->codec_priv.size = 0; | 103 track->codec_priv.size = 0; |
| 104 } else { | 104 } else { |
| 105 +#if CONFIG_SIPR_DECODER | 105 +#if CONFIG_SIPR_DECODER |
| 106 if (codec_id == CODEC_ID_SIPR && flavor < 4) { | 106 if (codec_id == CODEC_ID_SIPR && flavor < 4) { |
| 107 const int sipr_bit_rate[4] = { 6504, 8496, 5000, 16000 }; | 107 const int sipr_bit_rate[4] = { 6504, 8496, 5000, 16000 }; |
| 108 track->audio.sub_packet_size = ff_sipr_subpk_size[flavor]; | 108 track->audio.sub_packet_size = ff_sipr_subpk_size[flavor]; |
| 109 st->codec->bit_rate = sipr_bit_rate[flavor]; | 109 st->codec->bit_rate = sipr_bit_rate[flavor]; |
| 110 } | 110 } |
| 111 +#endif | 111 +#endif |
| 112 st->codec->block_align = track->audio.sub_packet_size; | 112 st->codec->block_align = track->audio.sub_packet_size; |
| 113 extradata_offset = 78; | 113 extradata_offset = 78; |
| 114 } | 114 } |
| 115 @@ -1448,6 +1465,8 @@ static int matroska_read_header(AVFormat | 115 @@ -1449,6 +1466,8 @@ static int matroska_read_header(AVFormat |
| 116 } else if (track->type == MATROSKA_TRACK_TYPE_AUDIO) { | 116 } else if (track->type == MATROSKA_TRACK_TYPE_AUDIO) { |
| 117 st->codec->codec_type = AVMEDIA_TYPE_AUDIO; | 117 st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
| 118 st->codec->sample_rate = track->audio.out_samplerate; | 118 st->codec->sample_rate = track->audio.out_samplerate; |
| 119 + if (st->codec->sample_rate <= 0) | 119 + if (st->codec->sample_rate <= 0) |
| 120 + st->codec->sample_rate = 1; | 120 + st->codec->sample_rate = 1; |
| 121 st->codec->channels = track->audio.channels; | 121 st->codec->channels = track->audio.channels; |
| 122 if (st->codec->codec_id != CODEC_ID_AAC) | 122 if (st->codec->codec_id != CODEC_ID_AAC) |
| 123 st->need_parsing = AVSTREAM_PARSE_HEADERS; | 123 st->need_parsing = AVSTREAM_PARSE_HEADERS; |
| 124 @@ -1727,8 +1746,10 @@ static int matroska_parse_block(Matroska | 124 @@ -1728,8 +1747,10 @@ static int matroska_parse_block(Matroska |
| 125 memcpy(track->audio.buf+sps*(h*x+((h+1)/2)*(y&1)+(y
>>1)), data+x*sps, sps); | 125 memcpy(track->audio.buf+sps*(h*x+((h+1)/2)*(y&1)+(y
>>1)), data+x*sps, sps); |
| 126 | 126 |
| 127 if (++track->audio.sub_packet_cnt >= h) { | 127 if (++track->audio.sub_packet_cnt >= h) { |
| 128 +#if CONFIG_SIPR_DECODER | 128 +#if CONFIG_SIPR_DECODER |
| 129 if (st->codec->codec_id == CODEC_ID_SIPR) | 129 if (st->codec->codec_id == CODEC_ID_SIPR) |
| 130 ff_rm_reorder_sipr_data(track->audio.buf, h, w); | 130 ff_rm_reorder_sipr_data(track->audio.buf, h, w); |
| 131 +#endif | 131 +#endif |
| 132 track->audio.sub_packet_cnt = 0; | 132 track->audio.sub_packet_cnt = 0; |
| 133 track->audio.pkt_cnt = h*w / a; | 133 track->audio.pkt_cnt = h*w / a; |
| 134 } | 134 } |
| OLD | NEW |