| @@ -292,12 +292,12 @@ int ff_mp4_read_descr_len(AVIOContext *pb) · 291 unmodified lines |
| 292 | return len; | 292 | return len; |
| 293 | } | 293 | } |
| 294 | | 294 | |
| 295 | int ff_mp4_read_descr(AVFormatContext *fc, AVIOContext *pb, int *tag) | 295 | int ff_mp4_read_descr(void *logctx, AVIOContext *pb, int *tag) |
| 296 | { | 296 | { |
| 297 | int len; | 297 | int len; |
| 298 | *tag = avio_r8(pb); | 298 | *tag = avio_r8(pb); |
| 299 | len = ff_mp4_read_descr_len(pb); | 299 | len = ff_mp4_read_descr_len(pb); |
| 300 | av_log(fc, AV_LOG_TRACE, "MPEG-4 description: tag=0x%02x len=%d\n", *tag, len); | 300 | av_log(logctx, AV_LOG_TRACE, "MPEG-4 description: tag=0x%02x len=%d\n", *tag, len); |
| 301 | return len; | 301 | return len; |
| 302 | } | 302 | } |
| 303 | | 303 | |
| @@ -326,7 +326,7 @@ static const AVCodecTag mp4_audio_types[] = { · 22 unmodified lines |
| 326 | { AV_CODEC_ID_NONE, AOT_NULL }, | 326 | { AV_CODEC_ID_NONE, AOT_NULL }, |
| 327 | }; | 327 | }; |
| 328 | | 328 | |
| 329 | int ff_mp4_read_dec_config_descr(AVFormatContext *fc, AVStream *st, AVIOContext *pb) | 329 | int ff_mp4_read_dec_config_descr(void *logctx, AVStream *st, AVIOContext *pb) |
| 330 | { | 330 | { |
| 331 | enum AVCodecID codec_id; | 331 | enum AVCodecID codec_id; |
| 332 | int len, tag; | 332 | int len, tag; |
| @@ -341,22 +341,22 @@ int ff_mp4_read_dec_config_descr(AVFormatContext *fc, AVStream *st, AVIOContext · 8 unmodified lines |
| 341 | codec_id= ff_codec_get_id(ff_mp4_obj_type, object_type_id); | 341 | codec_id= ff_codec_get_id(ff_mp4_obj_type, object_type_id); |
| 342 | if (codec_id) | 342 | if (codec_id) |
| 343 | st->codecpar->codec_id = codec_id; | 343 | st->codecpar->codec_id = codec_id; |
| 344 | av_log(fc, AV_LOG_TRACE, "esds object type id 0x%02x\n", object_type_id); | 344 | av_log(logctx, AV_LOG_TRACE, "esds object type id 0x%02x\n", object_type_id); |
| 345 | len = ff_mp4_read_descr(fc, pb, &tag); | 345 | len = ff_mp4_read_descr(logctx, pb, &tag); |
| 346 | if (tag == MP4DecSpecificDescrTag) { | 346 | if (tag == MP4DecSpecificDescrTag) { |
| 347 | av_log(fc, AV_LOG_TRACE, "Specific MPEG-4 header len=%d\n", len); | 347 | av_log(logctx, AV_LOG_TRACE, "Specific MPEG-4 header len=%d\n", len); |
| 348 | /* As per 14496-3:2009 9.D.2.2, No decSpecificInfo is defined | 348 | /* As per 14496-3:2009 9.D.2.2, No decSpecificInfo is defined |
| 349 | for MPEG-1 Audio or MPEG-2 Audio; MPEG-2 AAC excluded. */ | 349 | for MPEG-1 Audio or MPEG-2 Audio; MPEG-2 AAC excluded. */ |
| 350 | if (object_type_id == 0x69 || object_type_id == 0x6b) | 350 | if (object_type_id == 0x69 || object_type_id == 0x6b) |
| 351 | return 0; | 351 | return 0; |
| 352 | if (!len || (uint64_t)len > (1<<30)) | 352 | if (!len || (uint64_t)len > (1<<30)) |
| 353 | return AVERROR_INVALIDDATA; | 353 | return AVERROR_INVALIDDATA; |
| 354 | if ((ret = ff_get_extradata(fc, st->codecpar, pb, len)) < 0) | 354 | if ((ret = ff_get_extradata(logctx, st->codecpar, pb, len)) < 0) |
| 355 | return ret; | 355 | return ret; |
| 356 | if (st->codecpar->codec_id == AV_CODEC_ID_AAC) { | 356 | if (st->codecpar->codec_id == AV_CODEC_ID_AAC) { |
| 357 | MPEG4AudioConfig cfg = {0}; | 357 | MPEG4AudioConfig cfg = {0}; |
| 358 | ret = avpriv_mpeg4audio_get_config2(&cfg, st->codecpar->extradata, | 358 | ret = avpriv_mpeg4audio_get_config2(&cfg, st->codecpar->extradata, |
| 359 | st->codecpar->extradata_size, 1, fc); | 359 | st->codecpar->extradata_size, 1, logctx); |
| 360 | if (ret < 0) | 360 | if (ret < 0) |
| 361 | return ret; | 361 | return ret; |
| 362 | if (cfg.channels != st->codecpar->ch_layout.nb_channels) { | 362 | if (cfg.channels != st->codecpar->ch_layout.nb_channels) { |
| @@ -370,7 +370,7 @@ int ff_mp4_read_dec_config_descr(AVFormatContext *fc, AVStream *st, AVIOContext · 7 unmodified lines |
| 370 | st->codecpar->sample_rate = cfg.ext_sample_rate; | 370 | st->codecpar->sample_rate = cfg.ext_sample_rate; |
| 371 | else | 371 | else |
| 372 | st->codecpar->sample_rate = cfg.sample_rate; | 372 | st->codecpar->sample_rate = cfg.sample_rate; |
| 373 | av_log(fc, AV_LOG_TRACE, "mp4a config channels %d obj %d ext obj %d " | 373 | av_log(logctx, AV_LOG_TRACE, "mp4a config channels %d obj %d ext obj %d " |
| 374 | "sample rate %d ext sample rate %d\n", cfg.channels, | 374 | "sample rate %d ext sample rate %d\n", cfg.channels, |
| 375 | cfg.object_type, cfg.ext_object_type, | 375 | cfg.object_type, cfg.ext_object_type, |
| 376 | cfg.sample_rate, cfg.ext_sample_rate); | 376 | cfg.sample_rate, cfg.ext_sample_rate); |