Revision 17af0525 libavformat/asfdec.c

View differences:

libavformat/asfdec.c
54 54
static void print_guid(const GUID *g)
55 55
{
56 56
    int i;
57
    PRINT_IF_GUID(g, asf_header);
58
    else PRINT_IF_GUID(g, file_header);
59
    else PRINT_IF_GUID(g, stream_header);
60
    else PRINT_IF_GUID(g, audio_stream);
61
    else PRINT_IF_GUID(g, audio_conceal_none);
62
    else PRINT_IF_GUID(g, video_stream);
63
    else PRINT_IF_GUID(g, video_conceal_none);
64
    else PRINT_IF_GUID(g, command_stream);
65
    else PRINT_IF_GUID(g, comment_header);
66
    else PRINT_IF_GUID(g, codec_comment_header);
67
    else PRINT_IF_GUID(g, codec_comment1_header);
68
    else PRINT_IF_GUID(g, data_header);
57
    PRINT_IF_GUID(g, ff_asf_header);
58
    else PRINT_IF_GUID(g, ff_asf_file_header);
59
    else PRINT_IF_GUID(g, ff_asf_stream_header);
60
    else PRINT_IF_GUID(g, ff_asf_audio_stream);
61
    else PRINT_IF_GUID(g, ff_asf_audio_conceal_none);
62
    else PRINT_IF_GUID(g, ff_asf_video_stream);
63
    else PRINT_IF_GUID(g, ff_asf_video_conceal_none);
64
    else PRINT_IF_GUID(g, ff_asf_command_stream);
65
    else PRINT_IF_GUID(g, ff_asf_comment_header);
66
    else PRINT_IF_GUID(g, ff_asf_codec_comment_header);
67
    else PRINT_IF_GUID(g, ff_asf_codec_comment1_header);
68
    else PRINT_IF_GUID(g, ff_asf_data_header);
69 69
    else PRINT_IF_GUID(g, index_guid);
70
    else PRINT_IF_GUID(g, head1_guid);
71
    else PRINT_IF_GUID(g, head2_guid);
72
    else PRINT_IF_GUID(g, my_guid);
73
    else PRINT_IF_GUID(g, ext_stream_header);
74
    else PRINT_IF_GUID(g, extended_content_header);
75
    else PRINT_IF_GUID(g, ext_stream_embed_stream_header);
76
    else PRINT_IF_GUID(g, ext_stream_audio_stream);
77
    else PRINT_IF_GUID(g, metadata_header);
70
    else PRINT_IF_GUID(g, ff_asf_head1_guid);
71
    else PRINT_IF_GUID(g, ff_asf_head2_guid);
72
    else PRINT_IF_GUID(g, ff_asf_my_guid);
73
    else PRINT_IF_GUID(g, ff_asf_ext_stream_header);
74
    else PRINT_IF_GUID(g, ff_asf_extended_content_header);
75
    else PRINT_IF_GUID(g, ff_asf_ext_stream_embed_stream_header);
76
    else PRINT_IF_GUID(g, ff_asf_ext_stream_audio_stream);
77
    else PRINT_IF_GUID(g, ff_asf_metadata_header);
78 78
    else PRINT_IF_GUID(g, stream_bitrate_guid);
79 79
    else
80 80
        dprintf(NULL, "(GUID: unknown) ");
......
125 125
static int asf_probe(AVProbeData *pd)
126 126
{
127 127
    /* check file header */
128
    if (!memcmp(pd->buf, &asf_header, sizeof(GUID)))
128
    if (!memcmp(pd->buf, &ff_asf_header, sizeof(GUID)))
129 129
        return AVPROBE_SCORE_MAX;
130 130
    else
131 131
        return 0;
......
174 174
    memset(bitrate, 0, sizeof(bitrate));
175 175

  
176 176
    get_guid(pb, &g);
177
    if (memcmp(&g, &asf_header, sizeof(GUID)))
177
    if (memcmp(&g, &ff_asf_header, sizeof(GUID)))
178 178
        return -1;
179 179
    get_le64(pb);
180 180
    get_le32(pb);
......
187 187
        dprintf(s, "%08"PRIx64": ", url_ftell(pb) - 24);
188 188
        print_guid(&g);
189 189
        dprintf(s, "  size=0x%"PRIx64"\n", gsize);
190
        if (!memcmp(&g, &data_header, sizeof(GUID))) {
190
        if (!memcmp(&g, &ff_asf_data_header, sizeof(GUID))) {
191 191
            asf->data_object_offset = url_ftell(pb);
192 192
            // if not streaming, gsize is not unlimited (how?), and there is enough space in the file..
193 193
            if (!(asf->hdr.flags & 0x01) && gsize >= 100) {
......
199 199
        }
200 200
        if (gsize < 24)
201 201
            return -1;
202
        if (!memcmp(&g, &file_header, sizeof(GUID))) {
202
        if (!memcmp(&g, &ff_asf_file_header, sizeof(GUID))) {
203 203
            get_guid(pb, &asf->hdr.guid);
204 204
            asf->hdr.file_size          = get_le64(pb);
205 205
            asf->hdr.create_time        = get_le64(pb);
......
213 213
            asf->hdr.max_pktsize        = get_le32(pb);
214 214
            asf->hdr.max_bitrate        = get_le32(pb);
215 215
            asf->packet_size = asf->hdr.max_pktsize;
216
        } else if (!memcmp(&g, &stream_header, sizeof(GUID))) {
216
        } else if (!memcmp(&g, &ff_asf_stream_header, sizeof(GUID))) {
217 217
            enum CodecType type;
218 218
            int type_specific_size, sizeX;
219 219
            uint64_t total_size;
......
240 240
            get_guid(pb, &g);
241 241

  
242 242
            test_for_ext_stream_audio = 0;
243
            if (!memcmp(&g, &audio_stream, sizeof(GUID))) {
243
            if (!memcmp(&g, &ff_asf_audio_stream, sizeof(GUID))) {
244 244
                type = CODEC_TYPE_AUDIO;
245
            } else if (!memcmp(&g, &video_stream, sizeof(GUID))) {
245
            } else if (!memcmp(&g, &ff_asf_video_stream, sizeof(GUID))) {
246 246
                type = CODEC_TYPE_VIDEO;
247
            } else if (!memcmp(&g, &command_stream, sizeof(GUID))) {
247
            } else if (!memcmp(&g, &ff_asf_command_stream, sizeof(GUID))) {
248 248
                type = CODEC_TYPE_DATA;
249
            } else if (!memcmp(&g, &ext_stream_embed_stream_header, sizeof(GUID))) {
249
            } else if (!memcmp(&g, &ff_asf_ext_stream_embed_stream_header, sizeof(GUID))) {
250 250
                test_for_ext_stream_audio = 1;
251 251
                type = CODEC_TYPE_UNKNOWN;
252 252
            } else {
......
264 264

  
265 265
            if (test_for_ext_stream_audio) {
266 266
                get_guid(pb, &g);
267
                if (!memcmp(&g, &ext_stream_audio_stream, sizeof(GUID))) {
267
                if (!memcmp(&g, &ff_asf_ext_stream_audio_stream, sizeof(GUID))) {
268 268
                    type = CODEC_TYPE_AUDIO;
269 269
                    is_dvr_ms_audio=1;
270 270
                    get_guid(pb, &g);
......
370 370
            }
371 371
            pos2 = url_ftell(pb);
372 372
            url_fskip(pb, gsize - (pos2 - pos1 + 24));
373
        } else if (!memcmp(&g, &comment_header, sizeof(GUID))) {
373
        } else if (!memcmp(&g, &ff_asf_comment_header, sizeof(GUID))) {
374 374
            int len1, len2, len3, len4, len5;
375 375

  
376 376
            len1 = get_le16(pb);
......
398 398
//                av_log(s, AV_LOG_ERROR, "flags: 0x%x stream id %d, bitrate %d\n", flags, stream_id, bitrate);
399 399
                asf->stream_bitrates[stream_id]= bitrate;
400 400
            }
401
       } else if (!memcmp(&g, &extended_content_header, sizeof(GUID))) {
401
       } else if (!memcmp(&g, &ff_asf_extended_content_header, sizeof(GUID))) {
402 402
                int desc_count, i;
403 403

  
404 404
                desc_count = get_le16(pb);
......
413 413
                        value_len = get_le16(pb);
414 414
                        get_tag(s, name, value_type, value_len);
415 415
                }
416
        } else if (!memcmp(&g, &metadata_header, sizeof(GUID))) {
416
        } else if (!memcmp(&g, &ff_asf_metadata_header, sizeof(GUID))) {
417 417
            int n, stream_num, name_len, value_len, value_type, value_num;
418 418
            n = get_le16(pb);
419 419

  
......
436 436
                    else if(!strcmp(name, "AspectRatioY")) dar[stream_num].den= value_num;
437 437
                }
438 438
            }
439
        } else if (!memcmp(&g, &ext_stream_header, sizeof(GUID))) {
439
        } else if (!memcmp(&g, &ff_asf_ext_stream_header, sizeof(GUID))) {
440 440
            int ext_len, payload_ext_ct, stream_ct;
441 441
            uint32_t ext_d, leak_rate, stream_num;
442 442
            int64_t pos_ex_st;
......
476 476

  
477 477
            // there could be a optional stream properties object to follow
478 478
            // if so the next iteration will pick it up
479
        } else if (!memcmp(&g, &head1_guid, sizeof(GUID))) {
479
        } else if (!memcmp(&g, &ff_asf_head1_guid, sizeof(GUID))) {
480 480
            int v1, v2;
481 481
            get_guid(pb, &g);
482 482
            v1 = get_le32(pb);
483 483
            v2 = get_le16(pb);
484 484
#if 0
485
        } else if (!memcmp(&g, &codec_comment_header, sizeof(GUID))) {
485
        } else if (!memcmp(&g, &ff_asf_codec_comment_header, sizeof(GUID))) {
486 486
            int len, v1, n, num;
487 487
            char str[256], *q;
488 488
            char tag[16];

Also available in: Unified diff