]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/qcp.c
lavc: allow decoders to override frame parameters.
[ffmpeg] / libavformat / qcp.c
index 291eb182edc6b28fc7d94d11c68b6782a3ae478c..30d362f9384162c457057670deb8962b5ac688a7 100644 (file)
@@ -27,6 +27,7 @@
  *     http://tools.ietf.org/html/rfc3625
  */
 
+#include "libavutil/channel_layout.h"
 #include "libavutil/intreadwrite.h"
 #include "avformat.h"
 
@@ -80,11 +81,11 @@ static int qcp_probe(AVProbeData *pd)
     return 0;
 }
 
-static int qcp_read_header(AVFormatContext *s, AVFormatParameters *ap)
+static int qcp_read_header(AVFormatContext *s)
 {
     AVIOContext *pb = s->pb;
     QCPContext    *c  = s->priv_data;
-    AVStream      *st = av_new_stream(s, 0);
+    AVStream      *st = avformat_new_stream(s, NULL);
     uint8_t       buf[16];
     int           i, nb_rates;
 
@@ -96,9 +97,10 @@ static int qcp_read_header(AVFormatContext *s, AVFormatParameters *ap)
 
     st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
     st->codec->channels   = 1;
+    st->codec->channel_layout = AV_CH_LAYOUT_MONO;
     avio_read(pb, buf, 16);
     if (is_qcelp_13k_guid(buf)) {
-        st->codec->codec_id = CODEC_ID_QCELP;
+        st->codec->codec_id = AV_CODEC_ID_QCELP;
     } else if (!memcmp(buf, guid_evrc, 16)) {
         av_log(s, AV_LOG_ERROR, "EVRC codec is not supported.\n");
         return AVERROR_PATCHWELCOME;
@@ -188,7 +190,7 @@ static int qcp_read_packet(AVFormatContext *s, AVPacket *pkt)
 
 AVInputFormat ff_qcp_demuxer = {
     .name           = "qcp",
-    .long_name      = NULL_IF_CONFIG_SMALL("QCP format"),
+    .long_name      = NULL_IF_CONFIG_SMALL("QCP"),
     .priv_data_size = sizeof(QCPContext),
     .read_probe     = qcp_probe,
     .read_header    = qcp_read_header,