mirror of https://git.ffmpeg.org/ffmpeg.git
stsd fix by (Baptiste COUDURIER )baptiste.coudurier smartjog com)
Originally committed as revision 4994 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
1a9150b194
commit
3840147e12
|
@ -831,17 +831,21 @@ static int mov_read_wave(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
|
||||||
if((uint64_t)atom.size > (1<<30))
|
if((uint64_t)atom.size > (1<<30))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
// pass all frma atom to codec, needed at least for QDM2
|
if (st->codec->codec_id == CODEC_ID_QDM2) {
|
||||||
av_free(st->codec->extradata);
|
// pass all frma atom to codec, needed at least for QDM2
|
||||||
st->codec->extradata_size = atom.size;
|
av_free(st->codec->extradata);
|
||||||
st->codec->extradata = (uint8_t*) av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
|
st->codec->extradata_size = atom.size;
|
||||||
|
st->codec->extradata = (uint8_t*) av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||||
|
|
||||||
if (st->codec->extradata) {
|
if (st->codec->extradata) {
|
||||||
get_buffer(pb, st->codec->extradata, atom.size);
|
get_buffer(pb, st->codec->extradata, atom.size);
|
||||||
//av_log(NULL, AV_LOG_DEBUG, "Reading frma %Ld %s\n", atom.size, (char*)st->codec->extradata);
|
//av_log(NULL, AV_LOG_DEBUG, "Reading frma %Ld %s\n", atom.size, (char*)st->codec->extradata);
|
||||||
} else
|
} else
|
||||||
|
url_fskip(pb, atom.size);
|
||||||
|
} else if (atom.size > 8) { /* to read frma, esds atoms */
|
||||||
|
mov_read_default(c, pb, atom);
|
||||||
|
} else if (atom.size > 0)
|
||||||
url_fskip(pb, atom.size);
|
url_fskip(pb, atom.size);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -944,6 +948,7 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
|
||||||
|
|
||||||
while(entries--) { //Parsing Sample description table
|
while(entries--) { //Parsing Sample description table
|
||||||
enum CodecID id;
|
enum CodecID id;
|
||||||
|
offset_t start_pos = url_ftell(pb);
|
||||||
int size = get_be32(pb); /* size */
|
int size = get_be32(pb); /* size */
|
||||||
format = get_le32(pb); /* data format */
|
format = get_le32(pb); /* data format */
|
||||||
|
|
||||||
|
@ -1006,7 +1011,6 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
|
||||||
st->codec->time_base.den = 25;
|
st->codec->time_base.den = 25;
|
||||||
st->codec->time_base.num = 1;
|
st->codec->time_base.num = 1;
|
||||||
*/
|
*/
|
||||||
size -= (16+8*4+2+32+2*2);
|
|
||||||
#if 0
|
#if 0
|
||||||
while (size >= 8) {
|
while (size >= 8) {
|
||||||
MOV_atom_t a;
|
MOV_atom_t a;
|
||||||
|
@ -1147,8 +1151,11 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
|
||||||
} else
|
} else
|
||||||
st->codec->palctrl = NULL;
|
st->codec->palctrl = NULL;
|
||||||
|
|
||||||
a.size = size;
|
a.size = size - (url_ftell(pb) - start_pos);
|
||||||
mov_read_default(c, pb, a);
|
if (a.size > 8)
|
||||||
|
mov_read_default(c, pb, a);
|
||||||
|
else if (a.size > 0)
|
||||||
|
url_fskip(pb, a.size);
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
st->codec->codec_id = codec_get_id(mov_audio_tags, format);
|
st->codec->codec_id = codec_get_id(mov_audio_tags, format);
|
||||||
|
|
Loading…
Reference in New Issue