#ifdef DEBUG
#define PRINT_IF_GUID(g,cmp) \
if (!memcmp(g, &cmp, sizeof(GUID))) \
- printf("(GUID: %s) ", #cmp)
+ dprintf(NULL, "(GUID: %s) ", #cmp)
static void print_guid(const GUID *g)
{
else PRINT_IF_GUID(g, metadata_header);
else PRINT_IF_GUID(g, stream_bitrate_guid);
else
- printf("(GUID: unknown) ");
+ dprintf(NULL, "(GUID: unknown) ");
for(i=0;i<16;i++)
- printf(" 0x%02x,", (*g)[i]);
- printf("}\n");
+ dprintf(NULL, " 0x%02x,", (*g)[i]);
+ dprintf(NULL, "}\n");
}
#undef PRINT_IF_GUID
+#else
+#define print_guid(g)
#endif
static void get_guid(ByteIOContext *s, GUID *g)
for(;;) {
get_guid(pb, &g);
gsize = get_le64(pb);
-#ifdef DEBUG
- printf("%08"PRIx64": ", url_ftell(pb) - 24);
+ dprintf(s, "%08"PRIx64": ", url_ftell(pb) - 24);
print_guid(&g);
- printf(" size=0x%"PRIx64"\n", gsize);
-#endif
+ dprintf(s, " size=0x%"PRIx64"\n", gsize);
if (!memcmp(&g, &data_header, sizeof(GUID))) {
asf->data_object_offset = url_ftell(pb);
// if not streaming, gsize is not unlimited (how?), and there is enough space in the file..
st->codec->height = get_le32(pb);
/* not available for asf */
get_le16(pb); /* panes */
- st->codec->bits_per_sample = get_le16(pb); /* depth */
+ st->codec->bits_per_coded_sample = get_le16(pb); /* depth */
tag1 = get_le32(pb);
url_fskip(pb, 20);
// av_log(NULL, AV_LOG_DEBUG, "size:%d tsize:%d sizeX:%d\n", size, total_size, sizeX);
/* Extract palette from extradata if bpp <= 8 */
/* This code assumes that extradata contains only palette */
/* This is true for all paletted codecs implemented in ffmpeg */
- if (st->codec->extradata_size && (st->codec->bits_per_sample <= 8)) {
+ if (st->codec->extradata_size && (st->codec->bits_per_coded_sample <= 8)) {
st->codec->palctrl = av_mallocz(sizeof(AVPaletteControl));
#ifdef WORDS_BIGENDIAN
for (i = 0; i < FFMIN(st->codec->extradata_size, AVPALETTE_SIZE)/4; i++)
for(i=0; i<128; i++){
int stream_num= asf->asfid2avid[i];
if(stream_num>=0){
- AVCodecContext *codec= s->streams[stream_num]->codec;
- if (!codec->bit_rate)
- codec->bit_rate = bitrate[i];
+ AVStream *st = s->streams[stream_num];
+ if (!st->codec->bit_rate)
+ st->codec->bit_rate = bitrate[i];
if (dar[i].num > 0 && dar[i].den > 0)
- av_reduce(&codec->sample_aspect_ratio.num,
- &codec->sample_aspect_ratio.den,
+ av_reduce(&st->sample_aspect_ratio.num,
+ &st->sample_aspect_ratio.den,
dar[i].num, dar[i].den, INT_MAX);
-//av_log(NULL, AV_LOG_ERROR, "dar %d:%d sar=%d:%d\n", dar[i].num, dar[i].den, codec->sample_aspect_ratio.num, codec->sample_aspect_ratio.den);
+//av_log(NULL, AV_LOG_ERROR, "dar %d:%d sar=%d:%d\n", dar[i].num, dar[i].den, st->sample_aspect_ratio.num, st->sample_aspect_ratio.den);
}
}
if (packet_length < asf->hdr.min_pktsize)
padsize += asf->hdr.min_pktsize - packet_length;
asf->packet_padsize = padsize;
-#ifdef DEBUG
- printf("packet: size=%d padsize=%d left=%d\n", asf->packet_size, asf->packet_padsize, asf->packet_size_left);
-#endif
+ dprintf(s, "packet: size=%d padsize=%d left=%d\n", asf->packet_size, asf->packet_padsize, asf->packet_size_left);
return 0;
}