History

lavf/rawdec: Autodetect raw TrueHD streams.

Carl Eugen Hoyos committed 11 years ago

Commit da767f01 parent 94d50b52 files · +17 −4Browse files

Unified · Split

2 files
  1. libavformat/rawdec.c +16 −3
  2. libavformat/version.h +1 −1
libavformat/rawdec.c+16−3
@@ -206,14 +206,14 @@ static int mjpeg_probe(AVProbeData *p) · 205 unmodified lines
206206 FF_DEF_RAWVIDEO_DEMUXER2(mjpeg, "raw MJPEG video", mjpeg_probe, "mjpg,mjpeg,mpo", AV_CODEC_ID_MJPEG, AVFMT_GENERIC_INDEX|AVFMT_NOTIMESTAMPS)
207207 #endif
208208
209−#if CONFIG_MLP_DEMUXER
210−static int mlp_probe(AVProbeData *p)
209+#if CONFIG_MLP_DEMUXER || CONFIG_TRUEHD_DEMUXER
210+static int av_always_inline mlp_thd_probe(AVProbeData *p, uint32_t sync)
211211 {
212212 const uint8_t *buf, *last_buf = p->buf, *end = p->buf + p->buf_size;
213213 int frames = 0, valid = 0, size = 0;
214214
215215 for (buf = p->buf; buf + 8 <= end; buf++) {
216− if (AV_RB32(buf + 4) == 0xf8726fbb) {
216+ if (AV_RB32(buf + 4) == sync) {
217217 frames++;
218218 if (last_buf + size == buf) {
219219 valid++;
@@ -228,6 +228,13 @@ static int mlp_probe(AVProbeData *p) · 8 unmodified lines
228228 return AVPROBE_SCORE_MAX;
229229 return 0;
230230 }
231+#endif
232+
233+#if CONFIG_MLP_DEMUXER
234+static int mlp_probe(AVProbeData *p)
235+{
236+ return mlp_thd_probe(p, 0xf8726fbb);
237+}
231238
232239 AVInputFormat ff_mlp_demuxer = {
233240 .name = "mlp",
@@ -242,9 +249,15 @@ AVInputFormat ff_mlp_demuxer = { · 8 unmodified lines
242249 #endif
243250
244251 #if CONFIG_TRUEHD_DEMUXER
252+static int thd_probe(AVProbeData *p)
253+{
254+ return mlp_thd_probe(p, 0xf8726fba);
255+}
256+
245257 AVInputFormat ff_truehd_demuxer = {
246258 .name = "truehd",
247259 .long_name = NULL_IF_CONFIG_SMALL("raw TrueHD"),
260+ .read_probe = thd_probe,
248261 .read_header = ff_raw_audio_read_header,
249262 .read_packet = ff_raw_read_partial_packet,
250263 .flags = AVFMT_GENERIC_INDEX | AVFMT_NOTIMESTAMPS,
libavformat/version.h+1−1
@@ -31,7 +31,7 @@ · 30 unmodified lines
3131
3232 #define LIBAVFORMAT_VERSION_MAJOR 57
3333 #define LIBAVFORMAT_VERSION_MINOR 2
34−#define LIBAVFORMAT_VERSION_MICRO 101
34+#define LIBAVFORMAT_VERSION_MICRO 102
3535
3636 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
3737 LIBAVFORMAT_VERSION_MINOR, \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t