]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/spdifdec.c
doc: Improve the channelsplit example
[ffmpeg] / libavformat / spdifdec.c
index c8d4a3f430c1800d82e116ddc3fd094345431046..a28adf8224671982d3b42454d8599bb50fabfc7d 100644 (file)
@@ -91,8 +91,8 @@ static int spdif_get_offset_and_codec(AVFormatContext *s,
         break;
     default:
         if (s) { /* be silent during a probe */
-            av_log(s, AV_LOG_WARNING, "Data type 0x%04x", data_type);
-            av_log_missing_feature(s, " in IEC 61937", 1);
+            avpriv_request_sample(s, "Data type 0x%04x in IEC 61937",
+                                  data_type);
         }
         return AVERROR_PATCHWELCOME;
     }
@@ -149,10 +149,10 @@ static int spdif_probe(AVProbeData *p)
 
     if (sync_codes >= 6)
         /* good amount of sync codes but with unexpected offsets */
-        return AVPROBE_SCORE_MAX / 2;
+        return AVPROBE_SCORE_EXTENSION;
 
     /* some sync codes were found */
-    return AVPROBE_SCORE_MAX / 8;
+    return AVPROBE_SCORE_EXTENSION / 4;
 }
 
 static int spdif_read_header(AVFormatContext *s)
@@ -179,7 +179,7 @@ static int spdif_read_packet(AVFormatContext *s, AVPacket *pkt)
     pkt_size_bits = avio_rl16(pb);
 
     if (pkt_size_bits % 16)
-        av_log_ask_for_sample(s, "Packet does not end to a 16-bit boundary.");
+        avpriv_request_sample(s, "Packet not ending at a 16-bit boundary");
 
     ret = av_new_packet(pkt, FFALIGN(pkt_size_bits, 16) >> 3);
     if (ret)
@@ -188,7 +188,7 @@ static int spdif_read_packet(AVFormatContext *s, AVPacket *pkt)
     pkt->pos = avio_tell(pb) - BURST_HEADER_SIZE;
 
     if (avio_read(pb, pkt->data, pkt->size) < pkt->size) {
-        av_free_packet(pkt);
+        av_packet_unref(pkt);
         return AVERROR_EOF;
     }
     ff_spdif_bswap_buf16((uint16_t *)pkt->data, (uint16_t *)pkt->data, pkt->size >> 1);
@@ -196,7 +196,7 @@ static int spdif_read_packet(AVFormatContext *s, AVPacket *pkt)
     ret = spdif_get_offset_and_codec(s, data_type, pkt->data,
                                      &offset, &codec_id);
     if (ret) {
-        av_free_packet(pkt);
+        av_packet_unref(pkt);
         return ret;
     }
 
@@ -207,7 +207,7 @@ static int spdif_read_packet(AVFormatContext *s, AVPacket *pkt)
         /* first packet, create a stream */
         AVStream *st = avformat_new_stream(s, NULL);
         if (!st) {
-            av_free_packet(pkt);
+            av_packet_unref(pkt);
             return AVERROR(ENOMEM);
         }
         st->codec->codec_type = AVMEDIA_TYPE_AUDIO;