annotate libmpcodecs/ad.c @ 35325:d462bb933886

Do not attempt to write into a file if opening it failed.
author reimar
date Sat, 10 Nov 2012 18:52:13 +0000
parents b924f0df5a1d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
30421
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 30244
diff changeset
1 /*
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 30244
diff changeset
2 * audio decoder interface
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 30244
diff changeset
3 *
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 30244
diff changeset
4 * This file is part of MPlayer.
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 30244
diff changeset
5 *
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 30244
diff changeset
6 * MPlayer is free software; you can redistribute it and/or modify
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 30244
diff changeset
7 * it under the terms of the GNU General Public License as published by
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 30244
diff changeset
8 * the Free Software Foundation; either version 2 of the License, or
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 30244
diff changeset
9 * (at your option) any later version.
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 30244
diff changeset
10 *
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 30244
diff changeset
11 * MPlayer is distributed in the hope that it will be useful,
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 30244
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 30244
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 30244
diff changeset
14 * GNU General Public License for more details.
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 30244
diff changeset
15 *
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 30244
diff changeset
16 * You should have received a copy of the GNU General Public License along
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 30244
diff changeset
17 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 30244
diff changeset
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
bbb6ebec87a0 Add missing license headers to all files in the libmpcodecs directory.
diego
parents: 30244
diff changeset
19 */
5344
7198d3eba09f ok, use ad_* stuff
arpi
parents:
diff changeset
20
7198d3eba09f ok, use ad_* stuff
arpi
parents:
diff changeset
21 #include <stdio.h>
7198d3eba09f ok, use ad_* stuff
arpi
parents:
diff changeset
22 #include <stdlib.h>
7198d3eba09f ok, use ad_* stuff
arpi
parents:
diff changeset
23 #include <string.h>
7198d3eba09f ok, use ad_* stuff
arpi
parents:
diff changeset
24
7198d3eba09f ok, use ad_* stuff
arpi
parents:
diff changeset
25 #include "config.h"
7198d3eba09f ok, use ad_* stuff
arpi
parents:
diff changeset
26
22599
4faee1254928 Add explicit location for headers from the stream/ directory.
diego
parents: 18765
diff changeset
27 #include "stream/stream.h"
22601
ed8f90096c65 Add explicit location for headers from the libmpdemux/ directory.
diego
parents: 22599
diff changeset
28 #include "libmpdemux/demuxer.h"
ed8f90096c65 Add explicit location for headers from the libmpdemux/ directory.
diego
parents: 22599
diff changeset
29 #include "libmpdemux/stheader.h"
5344
7198d3eba09f ok, use ad_* stuff
arpi
parents:
diff changeset
30 #include "ad.h"
7198d3eba09f ok, use ad_* stuff
arpi
parents:
diff changeset
31
31220
002cdc635c03 Use the -a52drc option also for the libavcodec decoder.
reimar
parents: 30634
diff changeset
32 float drc_level = 1.0;
002cdc635c03 Use the -a52drc option also for the libavcodec decoder.
reimar
parents: 30634
diff changeset
33
5344
7198d3eba09f ok, use ad_* stuff
arpi
parents:
diff changeset
34 /* Missed vorbis, mad, dshow */
7198d3eba09f ok, use ad_* stuff
arpi
parents:
diff changeset
35
31524
083786e4aaf2 MP3 decoding through libmpg123
diego
parents: 31220
diff changeset
36 extern const ad_functions_t mpcodecs_ad_mpg123;
30634
9c043456a260 Mark ad_functions_t structures and mpcodecs_ad_drivers array as const.
diego
parents: 30421
diff changeset
37 extern const ad_functions_t mpcodecs_ad_mp3lib;
9c043456a260 Mark ad_functions_t structures and mpcodecs_ad_drivers array as const.
diego
parents: 30421
diff changeset
38 extern const ad_functions_t mpcodecs_ad_ffmpeg;
9c043456a260 Mark ad_functions_t structures and mpcodecs_ad_drivers array as const.
diego
parents: 30421
diff changeset
39 extern const ad_functions_t mpcodecs_ad_liba52;
9c043456a260 Mark ad_functions_t structures and mpcodecs_ad_drivers array as const.
diego
parents: 30421
diff changeset
40 extern const ad_functions_t mpcodecs_ad_hwac3;
9c043456a260 Mark ad_functions_t structures and mpcodecs_ad_drivers array as const.
diego
parents: 30421
diff changeset
41 extern const ad_functions_t mpcodecs_ad_hwmpa;
9c043456a260 Mark ad_functions_t structures and mpcodecs_ad_drivers array as const.
diego
parents: 30421
diff changeset
42 extern const ad_functions_t mpcodecs_ad_pcm;
9c043456a260 Mark ad_functions_t structures and mpcodecs_ad_drivers array as const.
diego
parents: 30421
diff changeset
43 extern const ad_functions_t mpcodecs_ad_dvdpcm;
9c043456a260 Mark ad_functions_t structures and mpcodecs_ad_drivers array as const.
diego
parents: 30421
diff changeset
44 extern const ad_functions_t mpcodecs_ad_alaw;
9c043456a260 Mark ad_functions_t structures and mpcodecs_ad_drivers array as const.
diego
parents: 30421
diff changeset
45 extern const ad_functions_t mpcodecs_ad_imaadpcm;
9c043456a260 Mark ad_functions_t structures and mpcodecs_ad_drivers array as const.
diego
parents: 30421
diff changeset
46 extern const ad_functions_t mpcodecs_ad_msadpcm;
9c043456a260 Mark ad_functions_t structures and mpcodecs_ad_drivers array as const.
diego
parents: 30421
diff changeset
47 extern const ad_functions_t mpcodecs_ad_dk3adpcm;
9c043456a260 Mark ad_functions_t structures and mpcodecs_ad_drivers array as const.
diego
parents: 30421
diff changeset
48 extern const ad_functions_t mpcodecs_ad_dk4adpcm;
9c043456a260 Mark ad_functions_t structures and mpcodecs_ad_drivers array as const.
diego
parents: 30421
diff changeset
49 extern const ad_functions_t mpcodecs_ad_dshow;
9c043456a260 Mark ad_functions_t structures and mpcodecs_ad_drivers array as const.
diego
parents: 30421
diff changeset
50 extern const ad_functions_t mpcodecs_ad_dmo;
9c043456a260 Mark ad_functions_t structures and mpcodecs_ad_drivers array as const.
diego
parents: 30421
diff changeset
51 extern const ad_functions_t mpcodecs_ad_acm;
9c043456a260 Mark ad_functions_t structures and mpcodecs_ad_drivers array as const.
diego
parents: 30421
diff changeset
52 extern const ad_functions_t mpcodecs_ad_faad;
9c043456a260 Mark ad_functions_t structures and mpcodecs_ad_drivers array as const.
diego
parents: 30421
diff changeset
53 extern const ad_functions_t mpcodecs_ad_libvorbis;
9c043456a260 Mark ad_functions_t structures and mpcodecs_ad_drivers array as const.
diego
parents: 30421
diff changeset
54 extern const ad_functions_t mpcodecs_ad_speex;
9c043456a260 Mark ad_functions_t structures and mpcodecs_ad_drivers array as const.
diego
parents: 30421
diff changeset
55 extern const ad_functions_t mpcodecs_ad_libmad;
9c043456a260 Mark ad_functions_t structures and mpcodecs_ad_drivers array as const.
diego
parents: 30421
diff changeset
56 extern const ad_functions_t mpcodecs_ad_realaud;
9c043456a260 Mark ad_functions_t structures and mpcodecs_ad_drivers array as const.
diego
parents: 30421
diff changeset
57 extern const ad_functions_t mpcodecs_ad_libdv;
9c043456a260 Mark ad_functions_t structures and mpcodecs_ad_drivers array as const.
diego
parents: 30421
diff changeset
58 extern const ad_functions_t mpcodecs_ad_qtaudio;
34103
febe300dbfc0 S/PDIF passthrough decoder
diego
parents: 32142
diff changeset
59 extern const ad_functions_t mpcodecs_ad_spdif;
30634
9c043456a260 Mark ad_functions_t structures and mpcodecs_ad_drivers array as const.
diego
parents: 30421
diff changeset
60 extern const ad_functions_t mpcodecs_ad_twin;
9c043456a260 Mark ad_functions_t structures and mpcodecs_ad_drivers array as const.
diego
parents: 30421
diff changeset
61 extern const ad_functions_t mpcodecs_ad_libmusepack;
9c043456a260 Mark ad_functions_t structures and mpcodecs_ad_drivers array as const.
diego
parents: 30421
diff changeset
62 extern const ad_functions_t mpcodecs_ad_libdca;
5344
7198d3eba09f ok, use ad_* stuff
arpi
parents:
diff changeset
63
30634
9c043456a260 Mark ad_functions_t structures and mpcodecs_ad_drivers array as const.
diego
parents: 30421
diff changeset
64 const ad_functions_t * const mpcodecs_ad_drivers[] =
5344
7198d3eba09f ok, use ad_* stuff
arpi
parents:
diff changeset
65 {
31524
083786e4aaf2 MP3 decoding through libmpg123
diego
parents: 31220
diff changeset
66 #ifdef CONFIG_MPG123
083786e4aaf2 MP3 decoding through libmpg123
diego
parents: 31220
diff changeset
67 &mpcodecs_ad_mpg123,
083786e4aaf2 MP3 decoding through libmpg123
diego
parents: 31220
diff changeset
68 #endif
27341
e7c989f7a7c9 Start unifying names of internal preprocessor directives.
diego
parents: 26206
diff changeset
69 #ifdef CONFIG_LIBA52
5344
7198d3eba09f ok, use ad_* stuff
arpi
parents:
diff changeset
70 &mpcodecs_ad_liba52,
30244
5ba6784f6574 More changes needed to make ad_hwac3 truly independent from liba52.
reimar
parents: 28924
diff changeset
71 #endif
5344
7198d3eba09f ok, use ad_* stuff
arpi
parents:
diff changeset
72 &mpcodecs_ad_hwac3,
17397
2e20dd653147 ad_hwmpa: pass-through fake audio codec for hardware mpeg decoders
nicodvb
parents: 17151
diff changeset
73 &mpcodecs_ad_hwmpa,
32142
4614728cab25 build system: Merge all FFmpeg library checks into a single FFmpeg check.
diego
parents: 31974
diff changeset
74 #ifdef CONFIG_FFMPEG
5344
7198d3eba09f ok, use ad_* stuff
arpi
parents:
diff changeset
75 &mpcodecs_ad_ffmpeg,
34103
febe300dbfc0 S/PDIF passthrough decoder
diego
parents: 32142
diff changeset
76 &mpcodecs_ad_spdif,
5344
7198d3eba09f ok, use ad_* stuff
arpi
parents:
diff changeset
77 #endif
7198d3eba09f ok, use ad_* stuff
arpi
parents:
diff changeset
78 &mpcodecs_ad_pcm,
7198d3eba09f ok, use ad_* stuff
arpi
parents:
diff changeset
79 &mpcodecs_ad_dvdpcm,
7198d3eba09f ok, use ad_* stuff
arpi
parents:
diff changeset
80 &mpcodecs_ad_alaw,
7198d3eba09f ok, use ad_* stuff
arpi
parents:
diff changeset
81 &mpcodecs_ad_imaadpcm,
7198d3eba09f ok, use ad_* stuff
arpi
parents:
diff changeset
82 &mpcodecs_ad_msadpcm,
7198d3eba09f ok, use ad_* stuff
arpi
parents:
diff changeset
83 &mpcodecs_ad_dk3adpcm,
27341
e7c989f7a7c9 Start unifying names of internal preprocessor directives.
diego
parents: 26206
diff changeset
84 #ifdef CONFIG_WIN32DLL
5344
7198d3eba09f ok, use ad_* stuff
arpi
parents:
diff changeset
85 &mpcodecs_ad_dshow,
8326
4849a0cfc2aa DMO audio support (including 6ch support too)
arpi
parents: 8160
diff changeset
86 &mpcodecs_ad_dmo,
5344
7198d3eba09f ok, use ad_* stuff
arpi
parents:
diff changeset
87 &mpcodecs_ad_acm,
14276
fa80ed52127b TwinVQ decoder and demuxer
rtognimp
parents: 12827
diff changeset
88 &mpcodecs_ad_twin,
8160
2be30233c532 qt video dll codecs support
arpi
parents: 8026
diff changeset
89 #endif
27341
e7c989f7a7c9 Start unifying names of internal preprocessor directives.
diego
parents: 26206
diff changeset
90 #ifdef CONFIG_QTX_CODECS
8008
35d663ad0d95 qtaudio - audio decoder using win32 quicktime 5 dlls
arpi
parents: 7174
diff changeset
91 &mpcodecs_ad_qtaudio,
5344
7198d3eba09f ok, use ad_* stuff
arpi
parents:
diff changeset
92 #endif
27363
40057010b1fa Change a bunch of codec-specific preprocessor directives from a HAVE_
diego
parents: 27341
diff changeset
93 #ifdef CONFIG_FAAD
5454
c6252cfb68e2 ehh. vorbis support...
arpi
parents: 5408
diff changeset
94 &mpcodecs_ad_faad,
c6252cfb68e2 ehh. vorbis support...
arpi
parents: 5408
diff changeset
95 #endif
27363
40057010b1fa Change a bunch of codec-specific preprocessor directives from a HAVE_
diego
parents: 27341
diff changeset
96 #ifdef CONFIG_OGGVORBIS
7174
7672615cc811 sync driver names with codec-cfg
arpi
parents: 6927
diff changeset
97 &mpcodecs_ad_libvorbis,
5356
739cad21c32c Port dec_audio.c faad aac decoder to libmpcodecs, cleaned up code, improved buffering scheme.
atmos4
parents: 5345
diff changeset
98 #endif
27363
40057010b1fa Change a bunch of codec-specific preprocessor directives from a HAVE_
diego
parents: 27341
diff changeset
99 #ifdef CONFIG_SPEEX
16915
6b1d1e4adaea Speex support. Seeking and pts generation does not work.
reimar
parents: 15958
diff changeset
100 &mpcodecs_ad_speex,
6b1d1e4adaea Speex support. Seeking and pts generation does not work.
reimar
parents: 15958
diff changeset
101 #endif
27341
e7c989f7a7c9 Start unifying names of internal preprocessor directives.
diego
parents: 26206
diff changeset
102 #ifdef CONFIG_LIBMAD
5479
22b289d7f87f libmad support, rewritten from scratch using Xine decoder as sample
arpi
parents: 5454
diff changeset
103 &mpcodecs_ad_libmad,
22b289d7f87f libmad support, rewritten from scratch using Xine decoder as sample
arpi
parents: 5454
diff changeset
104 #endif
27341
e7c989f7a7c9 Start unifying names of internal preprocessor directives.
diego
parents: 26206
diff changeset
105 #ifdef CONFIG_REALCODECS
7174
7672615cc811 sync driver names with codec-cfg
arpi
parents: 6927
diff changeset
106 &mpcodecs_ad_realaud,
6367
489c4bcbda13 readaudio decoder - not yet working
arpi
parents: 5519
diff changeset
107 #endif
27363
40057010b1fa Change a bunch of codec-specific preprocessor directives from a HAVE_
diego
parents: 27341
diff changeset
108 #ifdef CONFIG_LIBDV095
6927
0145bba6e201 native DV audio/video decoders using libdv
arpi
parents: 6367
diff changeset
109 &mpcodecs_ad_libdv,
0145bba6e201 native DV audio/video decoders using libdv
arpi
parents: 6367
diff changeset
110 #endif
27363
40057010b1fa Change a bunch of codec-specific preprocessor directives from a HAVE_
diego
parents: 27341
diff changeset
111 #ifdef CONFIG_MUSEPACK
15958
087142ef3a2d musepack demuxing and decoding support (demuxing is v7 bitstream only).
reimar
parents: 14276
diff changeset
112 &mpcodecs_ad_libmusepack,
087142ef3a2d musepack demuxing and decoding support (demuxing is v7 bitstream only).
reimar
parents: 14276
diff changeset
113 #endif
27341
e7c989f7a7c9 Start unifying names of internal preprocessor directives.
diego
parents: 26206
diff changeset
114 #ifdef CONFIG_LIBDCA
23821
46b21d6fb61d DTS decoding via libdca
rtogni
parents: 22601
diff changeset
115 &mpcodecs_ad_libdca,
46b21d6fb61d DTS decoding via libdca
rtogni
parents: 22601
diff changeset
116 #endif
5344
7198d3eba09f ok, use ad_* stuff
arpi
parents:
diff changeset
117 NULL
7198d3eba09f ok, use ad_* stuff
arpi
parents:
diff changeset
118 };