]> git.sesse.net Git - ffmpeg/commitdiff
Use proper return values in case of missing features
authorDiego Biurrun <diego@biurrun.de>
Mon, 8 Oct 2012 22:41:34 +0000 (00:41 +0200)
committerDiego Biurrun <diego@biurrun.de>
Fri, 12 Oct 2012 18:56:54 +0000 (20:56 +0200)
13 files changed:
libavcodec/aac_adtstoasc_bsf.c
libavcodec/aacdec.c
libavcodec/ac3dec.c
libavcodec/alsdec.c
libavcodec/amrnbdec.c
libavcodec/amrwbdec.c
libavcodec/eac3dec.c
libavcodec/flacdec.c
libavcodec/mpc8.c
libavcodec/tta.c
libavcodec/wmaprodec.c
libavcodec/wmavoice.c
libavformat/rtpdec_qt.c

index a6599345bd56a672daa3ef66276a7f5ce0893d72..df9a3958dbfa82c42d44fcd8dd53cc45b1286160 100644 (file)
@@ -62,7 +62,7 @@ static int aac_adtstoasc_filter(AVBitStreamFilterContext *bsfc,
 
     if (!hdr.crc_absent && hdr.num_aac_frames > 1) {
         av_log_missing_feature(avctx, "Multiple RDBs per frame with CRC", 0);
-        return -1;
+        return AVERROR_PATCHWELCOME;
     }
 
     buf      += AAC_ADTS_HEADER_SIZE + 2*!hdr.crc_absent;
@@ -75,7 +75,7 @@ static int aac_adtstoasc_filter(AVBitStreamFilterContext *bsfc,
             init_get_bits(&gb, buf, buf_size * 8);
             if (get_bits(&gb, 3) != 5) {
                 av_log_missing_feature(avctx, "PCE based channel configuration, where the PCE is not the first syntax element", 0);
-                return -1;
+                return AVERROR_PATCHWELCOME;
             }
             init_put_bits(&pb, pce_data, MAX_PCE_SIZE);
             pce_size = avpriv_copy_pce_data(&pb, &gb)/8;
index 859414adc93a6618ed8cd15411ed96339cc1536f..4a6d3905f48fa818b6ff61190a3f52737c585a3d 100644 (file)
@@ -634,7 +634,7 @@ static int decode_ga_specific_config(AACContext *ac, AVCodecContext *avctx,
 
     if (get_bits1(gb)) { // frameLengthFlag
         av_log_missing_feature(avctx, "960/120 MDCT window", 1);
-        return -1;
+        return AVERROR_PATCHWELCOME;
     }
 
     if (get_bits1(gb))       // dependsOnCoreCoder
@@ -1635,7 +1635,7 @@ static int decode_ics(AACContext *ac, SingleChannelElement *sce,
             return -1;
         if (get_bits1(gb)) {
             av_log_missing_feature(ac->avctx, "SSR", 1);
-            return -1;
+            return AVERROR_PATCHWELCOME;
         }
     }
 
@@ -2324,7 +2324,7 @@ static int parse_adts_frame_header(AACContext *ac, GetBitContext *gb)
     if (size > 0) {
         if (hdr_info.num_aac_frames != 1) {
             av_log_missing_feature(ac->avctx, "More than one AAC RDB per ADTS frame", 0);
-            return -1;
+            return AVERROR_PATCHWELCOME;
         }
         push_output_configuration(ac);
         if (hdr_info.chan_config) {
@@ -2609,7 +2609,7 @@ static int latm_decode_audio_specific_config(struct LATMContext *latmctx,
     if (config_start_bit % 8) {
         av_log_missing_feature(latmctx->aac_ctx.avctx,
                                "Non-byte-aligned audio-specific config", 1);
-        return AVERROR_INVALIDDATA;
+        return AVERROR_PATCHWELCOME;
     }
     if (asclen <= 0)
         return AVERROR_INVALIDDATA;
index 12770db2de054173badc1d468d451ee0e32b71c0..4336ca5374faf09d1cafa00e5bb5544a988a7f37 100644 (file)
@@ -876,7 +876,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
             if (s->eac3 && get_bits1(gbc)) {
                 /* TODO: parse enhanced coupling strategy info */
                 av_log_missing_feature(s->avctx, "Enhanced coupling", 1);
-                return -1;
+                return AVERROR_PATCHWELCOME;
             }
 
             /* determine which channels are coupled */
index 1c3f0cbdb5a5d6e399b1dae073a881e42c232e46..ba9f3bba2e6b75fc139159817b2a1802c72d9917 100644 (file)
@@ -427,9 +427,9 @@ static int check_specific_config(ALSDecContext *ctx)
         }                                               \
     }
 
-    MISSING_ERR(sconf->floating,             "Floating point decoding",     -1);
-    MISSING_ERR(sconf->rlslms,               "Adaptive RLS-LMS prediction", -1);
-    MISSING_ERR(sconf->chan_sort,            "Channel sorting",              0);
+    MISSING_ERR(sconf->floating,  "Floating point decoding",     AVERROR_PATCHWELCOME);
+    MISSING_ERR(sconf->rlslms,    "Adaptive RLS-LMS prediction", AVERROR_PATCHWELCOME);
+    MISSING_ERR(sconf->chan_sort, "Channel sorting",             0);
 
     return error;
 }
index d0ad76c7ead584cfd56bbad25dfac981ed9002be..2cb06a6ead0a2fec642616a715370ea78710ea1b 100644 (file)
@@ -951,7 +951,7 @@ static int amrnb_decode_frame(AVCodecContext *avctx, void *data,
     }
     if (p->cur_frame_mode == MODE_DTX) {
         av_log_missing_feature(avctx, "dtx mode", 1);
-        return -1;
+        return AVERROR_PATCHWELCOME;
     }
 
     if (p->cur_frame_mode == MODE_12k2) {
index 18b34cff9b2b5cb1009d2c0ebd6847fc817367ae..5cc96ab7136a5dc11cfc0b939b74e73d699886ea 100644 (file)
@@ -1111,7 +1111,7 @@ static int amrwb_decode_frame(AVCodecContext *avctx, void *data,
 
     if (ctx->fr_cur_mode == MODE_SID) { /* Comfort noise frame */
         av_log_missing_feature(avctx, "SID mode", 1);
-        return -1;
+        return AVERROR_PATCHWELCOME;
     }
 
     ff_amr_bit_reorder((uint16_t *) &ctx->frame, sizeof(AMRWBFrame),
index 7072f783e4397e9d00b7f9f709d5957345297040..626698839db93fe08703aaa931673d02d9d111bc 100644 (file)
@@ -322,7 +322,7 @@ int ff_eac3_parse_header(AC3DecodeContext *s)
            handled like AC-3 DolbyNet, but we cannot be sure until we have a
            sample which utilizes this feature. */
         av_log_missing_feature(s->avctx, "Reduced sampling rates", 1);
-        return -1;
+        return AVERROR_PATCHWELCOME;
     }
     skip_bits(gbc, 5); // skip bitstream id
 
index f3f1b3a2830ddc46c11a2125e536f2c49f4697f4..b39feb679b676a3e7d7fa4a7449ed06af49ed8de 100644 (file)
@@ -372,7 +372,7 @@ static inline int decode_subframe(FLACContext *s, int channel)
     }
     if (bps > 32) {
         av_log_missing_feature(s->avctx, "decorrelated bit depth > 32", 0);
-        return -1;
+        return AVERROR_PATCHWELCOME;
     }
 
 //FIXME use av_log2 for types
index 91e228b07c3647f7e4238372f2fdfbc0e7d36d73..0331789bbbe8b91df576e3cdeaa59973f84b9ac8 100644 (file)
@@ -130,7 +130,7 @@ static av_cold int mpc8_decode_init(AVCodecContext * avctx)
     channels = get_bits(&gb, 4) + 1;
     if (channels > 2) {
         av_log_missing_feature(avctx, "Multichannel MPC SV8", 1);
-        return -1;
+        return AVERROR_PATCHWELCOME;
     }
     c->MSS = get_bits1(&gb);
     c->frames = 1 << (get_bits(&gb, 3) * 2);
index 7825c0c98006bab4eea82ea0c094f4f9b2556f27..e6117488dc71b0ceef84e9c99238a880f2f25503 100644 (file)
@@ -222,7 +222,7 @@ static av_cold int tta_decode_init(AVCodecContext * avctx)
         }
         if (s->format == FORMAT_ENCRYPTED) {
             av_log_missing_feature(s->avctx, "Encrypted TTA", 0);
-            return AVERROR(EINVAL);
+            return AVERROR_PATCHWELCOME;
         }
         avctx->channels = s->channels = get_bits(&s->gb, 16);
         avctx->bits_per_coded_sample = get_bits(&s->gb, 16);
index 1c9c6671e47172868e59039a97f5f9516ec26b48..50f85e2938a4ceb948aee3d81c13c6ffc39e4520 100644 (file)
@@ -314,7 +314,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
     bits = ff_wma_get_frame_len_bits(avctx->sample_rate, 3, s->decode_flags);
     if (bits > WMAPRO_BLOCK_MAX_BITS) {
         av_log_missing_feature(avctx, "14-bits block sizes", 1);
-        return AVERROR_INVALIDDATA;
+        return AVERROR_PATCHWELCOME;
     }
     s->samples_per_frame = 1 << bits;
 
index 4a7ba6dabca54620f6ab5e46249de9f492ee358f..2ed79a630284c632ead0ba7ec1217bea580c5eaf 100644 (file)
@@ -1763,7 +1763,7 @@ static int synth_superframe(AVCodecContext *ctx, int *got_frame_ptr)
      * the wild yet. */
     if (!get_bits1(gb)) {
         av_log_missing_feature(ctx, "WMAPro-in-WMAVoice support", 1);
-        return -1;
+        return AVERROR_PATCHWELCOME;
     }
 
     /* (optional) nr. of samples in superframe; always <= 480 and >= 0 */
index 5dd1af1bc8a2f3de99d0f5778cbb1c0202cd0bd7..30931326727312a5d757b456fed2ec6a45393804 100644 (file)
@@ -99,7 +99,7 @@ static int qt_rtp_parse_packet(AVFormatContext *s, PayloadContext *qt,
         if (!is_start || !is_finish) {
             av_log_missing_feature(s, "RTP-X-QT with payload description "
                                       "split over several packets", 1);
-            return AVERROR(ENOSYS);
+            return AVERROR_PATCHWELCOME;
         }
         skip_bits(&gb, 12); // reserved
         data_len = get_bits(&gb, 16);
@@ -162,7 +162,7 @@ static int qt_rtp_parse_packet(AVFormatContext *s, PayloadContext *qt,
 
     if (has_packet_info) {
         av_log_missing_feature(s, "RTP-X-QT with packet specific info", 1);
-        return AVERROR(ENOSYS);
+        return AVERROR_PATCHWELCOME;
     }
 
     alen = len - avio_tell(&pb);
@@ -225,7 +225,7 @@ static int qt_rtp_parse_packet(AVFormatContext *s, PayloadContext *qt,
 
     default:  /* unimplemented */
         av_log_missing_feature(NULL, "RTP-X-QT with packing scheme 2", 1);
-        return AVERROR(ENOSYS);
+        return AVERROR_PATCHWELCOME;
     }
 }