2017-03-14 15:43:29 +00:00
|
|
|
/*
|
2017-10-26 17:50:36 +00:00
|
|
|
* This file is part of FFmpeg.
|
2017-03-14 15:43:29 +00:00
|
|
|
*
|
2017-10-26 17:50:36 +00:00
|
|
|
* FFmpeg is free software; you can redistribute it and/or
|
2017-03-14 15:43:29 +00:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
2017-10-26 17:50:36 +00:00
|
|
|
* FFmpeg is distributed in the hope that it will be useful,
|
2017-03-14 15:43:29 +00:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2017-10-26 17:50:36 +00:00
|
|
|
* License along with FFmpeg; if not, write to the Free Software
|
2017-03-14 15:43:29 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "avformat.h"
|
|
|
|
#include "avio.h"
|
|
|
|
#include "isom.h"
|
|
|
|
|
|
|
|
int ff_mov_read_esds(AVFormatContext *fc, AVIOContext *pb)
|
|
|
|
{
|
|
|
|
AVStream *st;
|
2017-11-24 20:55:19 +00:00
|
|
|
int tag, ret = 0;
|
2017-03-14 15:43:29 +00:00
|
|
|
|
|
|
|
if (fc->nb_streams < 1)
|
|
|
|
return 0;
|
|
|
|
st = fc->streams[fc->nb_streams-1];
|
|
|
|
|
|
|
|
avio_rb32(pb); /* version + flags */
|
|
|
|
ff_mp4_read_descr(fc, pb, &tag);
|
|
|
|
if (tag == MP4ESDescrTag) {
|
|
|
|
ff_mp4_parse_es_descr(pb, NULL);
|
|
|
|
} else
|
|
|
|
avio_rb16(pb); /* ID */
|
|
|
|
|
|
|
|
ff_mp4_read_descr(fc, pb, &tag);
|
|
|
|
if (tag == MP4DecConfigDescrTag)
|
2017-11-24 20:55:19 +00:00
|
|
|
ret = ff_mp4_read_dec_config_descr(fc, st, pb);
|
|
|
|
|
|
|
|
return ret;
|
2017-03-14 15:43:29 +00:00
|
|
|
}
|