diff mbox

[FFmpeg-devel] lavf/aiffdec: Default to full rate qcelp as QT does.

Message ID 201609291739.52137.cehoyos@ag.or.at
State Accepted
Headers show

Commit Message

Carl Eugen Hoyos Sept. 29, 2016, 3:39 p.m. UTC
Hi!

Attached patch allows playback of some qcelp aiff files, 
just as QT plays them.

Please comment, Carl Eugen
From 66829d7a98aa87ff685a728d01b41be697c8de8a Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <cehoyos@ag.or.at>
Date: Thu, 29 Sep 2016 17:36:38 +0200
Subject: [PATCH] lavf/aiffdec: Default to full rate qcelp as QT does.

---
 libavformat/aiffdec.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c
index 9bff565..cd916f9 100644
--- a/libavformat/aiffdec.c
+++ b/libavformat/aiffdec.c
@@ -337,7 +337,10 @@  static int aiff_read_header(AVFormatContext *s)
     }
 
 got_sound:
-    if (!st->codecpar->block_align) {
+    if (!st->codecpar->block_align && st->codecpar->codec_id == AV_CODEC_ID_QCELP) {
+        av_log(s, AV_LOG_WARNING, "qcelp without wave chunk, assuming full rate\n");
+        st->codecpar->block_align = 35;
+    } else if (!st->codecpar->block_align) {
         av_log(s, AV_LOG_ERROR, "could not find COMM tag or invalid block_align value\n");
         return -1;
     }