allow early exit from esds parsing, so decoder info (type & bitrate) are

available even if no codec-specific data or other extras found


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6930 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
arpi 2002-08-05 18:22:51 +00:00
parent 4831d9f8ad
commit 305cbfe923
1 changed files with 5 additions and 3 deletions

View File

@ -102,13 +102,15 @@ int mp4_parse_esds(unsigned char *data, int datalen, esds_t *esds) {
esds->bufferSizeDB, esds->maxBitrate/1000.0,
esds->avgBitrate/1000.0);
esds->decoderConfigLen=0;
if (len < 15) {
freereturn(s,1);
freereturn(s,0);
}
/* get and verify DecSpecificInfoTag */
if (stream_read_char(s) != MP4DecSpecificDescrTag) {
freereturn(s,1);
freereturn(s,0);
}
/* read length */
@ -125,7 +127,7 @@ int mp4_parse_esds(unsigned char *data, int datalen, esds_t *esds) {
/* get and verify SLConfigDescrTag */
if(stream_read_char(s) != MP4SLConfigDescrTag) {
freereturn(s,1);
freereturn(s,0);
}
/* Note: SLConfig is usually constant value 2, size 1Byte */