comparison asfdec.c @ 4954:2a4f618b2da3 libavformat

move DEBUG define before include to get dprintf and move guidcmp before print_guid, fix compilation with DEBUG
author bcoudurier
date Sun, 24 May 2009 09:59:53 +0000
parents c090f960fc8a
children 6671e7510fca
comparison
equal deleted inserted replaced
4953:1b3487b81ac7 4954:2a4f618b2da3
17 * You should have received a copy of the GNU Lesser General Public 17 * You should have received a copy of the GNU Lesser General Public
18 * License along with FFmpeg; if not, write to the Free Software 18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */ 20 */
21 21
22 //#define DEBUG
23
22 #include "libavutil/common.h" 24 #include "libavutil/common.h"
23 #include "libavutil/avstring.h" 25 #include "libavutil/avstring.h"
24 #include "libavcodec/mpegaudio.h" 26 #include "libavcodec/mpegaudio.h"
25 #include "avformat.h" 27 #include "avformat.h"
26 #include "riff.h" 28 #include "riff.h"
44 0xce, 0x75, 0xf8, 0x7b, 0x8d, 0x46, 0xd1, 0x11, 0x8d, 0x82, 0x00, 0x60, 0x97, 0xc9, 0xa2, 0xb2 46 0xce, 0x75, 0xf8, 0x7b, 0x8d, 0x46, 0xd1, 0x11, 0x8d, 0x82, 0x00, 0x60, 0x97, 0xc9, 0xa2, 0xb2
45 }; 47 };
46 /**********************************/ 48 /**********************************/
47 /* decoding */ 49 /* decoding */
48 50
49 //#define DEBUG 51 static int guidcmp(const void *g1, const void *g2)
52 {
53 return memcmp(g1, g2, sizeof(ff_asf_guid));
54 }
50 55
51 #ifdef DEBUG 56 #ifdef DEBUG
52 #define PRINT_IF_GUID(g,cmp) \ 57 #define PRINT_IF_GUID(g,cmp) \
53 if (!guidcmp(g, &cmp)) \ 58 if (!guidcmp(g, &cmp)) \
54 dprintf(NULL, "(GUID: %s) ", #cmp) 59 dprintf(NULL, "(GUID: %s) ", #cmp)
88 #undef PRINT_IF_GUID 93 #undef PRINT_IF_GUID
89 #else 94 #else
90 #define print_guid(g) 95 #define print_guid(g)
91 #endif 96 #endif
92 97
93 static int guidcmp(const void *g1, const void *g2)
94 {
95 return memcmp(g1, g2, sizeof(ff_asf_guid));
96 }
97
98 static void get_guid(ByteIOContext *s, ff_asf_guid *g) 98 static void get_guid(ByteIOContext *s, ff_asf_guid *g)
99 { 99 {
100 assert(sizeof(*g) == 16); 100 assert(sizeof(*g) == 16);
101 get_buffer(s, *g, sizeof(*g)); 101 get_buffer(s, *g, sizeof(*g));
102 } 102 }