]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/daud.c
MPEGTS: Improve probe function
[ffmpeg] / libavformat / daud.c
index 4d7a179fa7acb1554d79676a168a163e428f1d2f..5f04e7aaeef07a5064628ffab628160aa64e3c06 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * D-Cinema audio decoder.
- * Copyright (c) 2005 Reimar Döffinger.
+ * D-Cinema audio demuxer
+ * Copyright (c) 2005 Reimar Döffinger
  *
  * This file is part of FFmpeg.
  *
@@ -22,6 +22,8 @@
 
 static int daud_header(AVFormatContext *s, AVFormatParameters *ap) {
     AVStream *st = av_new_stream(s, 0);
+    if (!st)
+        return AVERROR(ENOMEM);
     st->codec->codec_type = CODEC_TYPE_AUDIO;
     st->codec->codec_id = CODEC_ID_PCM_S24DAUD;
     st->codec->codec_tag = MKTAG('d', 'a', 'u', 'd');
@@ -34,10 +36,10 @@ static int daud_header(AVFormatContext *s, AVFormatParameters *ap) {
 }
 
 static int daud_packet(AVFormatContext *s, AVPacket *pkt) {
-    ByteIOContext *pb = &s->pb;
+    ByteIOContext *pb = s->pb;
     int ret, size;
     if (url_feof(pb))
-        return AVERROR_IO;
+        return AVERROR(EIO);
     size = get_be16(pb);
     get_be16(pb); // unknown
     ret = av_get_packet(pb, pkt, size);
@@ -47,7 +49,7 @@ static int daud_packet(AVFormatContext *s, AVPacket *pkt) {
 
 AVInputFormat daud_demuxer = {
     "daud",
-    "D-Cinema audio format",
+    NULL_IF_CONFIG_SMALL("D-Cinema audio format"),
     0,
     NULL,
     daud_header,