]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/au.c
rtpdec: Increase max rtp packet size to 8192
[ffmpeg] / libavformat / au.c
index d88ccfc5e27a8672e1e4ea005d36e805e027cac8..76da6e60920b16cb790eaf300e025133eca098a8 100644 (file)
@@ -69,7 +69,7 @@ static int au_read_header(AVFormatContext *s)
 
     tag = avio_rl32(pb);
     if (tag != MKTAG('.', 's', 'n', 'd'))
-        return -1;
+        return AVERROR_INVALIDDATA;
     size = avio_rb32(pb); /* header size */
     avio_rb32(pb);        /* data size */
 
@@ -85,13 +85,13 @@ static int au_read_header(AVFormatContext *s)
     codec = ff_codec_get_id(codec_au_tags, id);
 
     if (codec == AV_CODEC_ID_NONE) {
-        av_log_ask_for_sample(s, "unknown or unsupported codec tag: %u\n", id);
+        avpriv_request_sample(s, "unknown or unsupported codec tag: %u", id);
         return AVERROR_PATCHWELCOME;
     }
 
     bps = av_get_bits_per_sample(codec);
     if (!bps) {
-        av_log_ask_for_sample(s, "could not determine bits per sample\n");
+        avpriv_request_sample(s, "Unknown bits per sample");
         return AVERROR_PATCHWELCOME;
     }
 
@@ -107,7 +107,7 @@ static int au_read_header(AVFormatContext *s)
 
     st = avformat_new_stream(s, NULL);
     if (!st)
-        return -1;
+        return AVERROR(ENOMEM);
     st->codec->codec_type  = AVMEDIA_TYPE_AUDIO;
     st->codec->codec_tag   = id;
     st->codec->codec_id    = codec;
@@ -160,14 +160,14 @@ AVInputFormat ff_au_demuxer = {
 static int put_au_header(AVIOContext *pb, AVCodecContext *enc)
 {
     if (!enc->codec_tag)
-        return -1;
+        return AVERROR(EINVAL);
 
     ffio_wfourcc(pb, ".snd");                   /* magic number */
     avio_wb32(pb, 24);                          /* header size */
     avio_wb32(pb, AU_UNKNOWN_SIZE);             /* data size */
-    avio_wb32(pb, (uint32_t)enc->codec_tag);    /* codec ID */
+    avio_wb32(pb, enc->codec_tag);              /* codec ID */
     avio_wb32(pb, enc->sample_rate);
-    avio_wb32(pb, (uint32_t)enc->channels);
+    avio_wb32(pb, enc->channels);
 
     return 0;
 }
@@ -175,11 +175,12 @@ static int put_au_header(AVIOContext *pb, AVCodecContext *enc)
 static int au_write_header(AVFormatContext *s)
 {
     AVIOContext *pb = s->pb;
+    int ret;
 
     s->priv_data = NULL;
 
-    if (put_au_header(pb, s->streams[0]->codec) < 0)
-        return -1;
+    if ((ret = put_au_header(pb, s->streams[0]->codec)) < 0)
+        return ret;
 
     avio_flush(pb);