diff options
author | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2015-10-03 22:40:27 +0200 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2015-10-03 22:40:27 +0200 |
commit | 32a6d37a6bbdb1f8adedcfbc2144d7c05648ac2b (patch) | |
tree | 63ea79301ad0aaedbac76a4605a02f9fb64c1adb /libavformat/rawdec.c | |
parent | e306e43633a2a14cd18e4e3bc6fdedaa36da2863 (diff) | |
download | ffmpeg-32a6d37a6bbdb1f8adedcfbc2144d7c05648ac2b.tar.gz |
lavf/mlpdec: Simplify mlp/thd probe function.
Move the demuxers into their own file.
Diffstat (limited to 'libavformat/rawdec.c')
-rw-r--r-- | libavformat/rawdec.c | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/libavformat/rawdec.c b/libavformat/rawdec.c index 46ee21e206..16fb221648 100644 --- a/libavformat/rawdec.c +++ b/libavformat/rawdec.c @@ -206,66 +206,6 @@ static int mjpeg_probe(AVProbeData *p) FF_DEF_RAWVIDEO_DEMUXER2(mjpeg, "raw MJPEG video", mjpeg_probe, "mjpg,mjpeg,mpo", AV_CODEC_ID_MJPEG, AVFMT_GENERIC_INDEX|AVFMT_NOTIMESTAMPS) #endif -#if CONFIG_MLP_DEMUXER || CONFIG_TRUEHD_DEMUXER -static int av_always_inline mlp_thd_probe(AVProbeData *p, uint32_t sync) -{ - const uint8_t *buf, *last_buf = p->buf, *end = p->buf + p->buf_size; - int frames = 0, valid = 0, size = 0; - - for (buf = p->buf; buf + 8 <= end; buf++) { - if (AV_RB32(buf + 4) == sync) { - frames++; - if (last_buf + size == buf) { - valid++; - } - last_buf = buf; - size = (AV_RB16(buf) & 0xfff) * 2; - } else if (buf - last_buf == size) { - size += (AV_RB16(buf) & 0xfff) * 2; - } - } - if (valid >= 100) - return AVPROBE_SCORE_MAX; - return 0; -} -#endif - -#if CONFIG_MLP_DEMUXER -static int mlp_probe(AVProbeData *p) -{ - return mlp_thd_probe(p, 0xf8726fbb); -} - -AVInputFormat ff_mlp_demuxer = { - .name = "mlp", - .long_name = NULL_IF_CONFIG_SMALL("raw MLP"), - .read_probe = mlp_probe, - .read_header = ff_raw_audio_read_header, - .read_packet = ff_raw_read_partial_packet, - .flags = AVFMT_GENERIC_INDEX | AVFMT_NOTIMESTAMPS, - .extensions = "mlp", - .raw_codec_id = AV_CODEC_ID_MLP, -}; -#endif - -#if CONFIG_TRUEHD_DEMUXER -static int thd_probe(AVProbeData *p) -{ - return mlp_thd_probe(p, 0xf8726fba); -} - -AVInputFormat ff_truehd_demuxer = { - .name = "truehd", - .long_name = NULL_IF_CONFIG_SMALL("raw TrueHD"), - .read_probe = thd_probe, - .read_header = ff_raw_audio_read_header, - .read_packet = ff_raw_read_partial_packet, - .flags = AVFMT_GENERIC_INDEX | AVFMT_NOTIMESTAMPS, - .extensions = "thd", - .raw_codec_id = AV_CODEC_ID_TRUEHD, -}; -#endif - #if CONFIG_VC1_DEMUXER FF_DEF_RAWVIDEO_DEMUXER2(vc1, "raw VC-1", NULL, "vc1", AV_CODEC_ID_VC1, AVFMT_GENERIC_INDEX|AVFMT_NOTIMESTAMPS) #endif |