Mercurial > libavformat.hg
comparison utils.c @ 5222:8ef96c47c19e libavformat
Only use *ic_ptr when it has been initialized.
author | michael |
---|---|
date | Fri, 18 Sep 2009 13:19:13 +0000 |
parents | ebbaf1c20a84 |
children | 745917a7ac1d |
comparison
equal
deleted
inserted
replaced
5221:3fab66935e56 | 5222:8ef96c47c19e |
---|---|
435 AVFormatParameters *ap) | 435 AVFormatParameters *ap) |
436 { | 436 { |
437 int err, probe_size; | 437 int err, probe_size; |
438 AVProbeData probe_data, *pd = &probe_data; | 438 AVProbeData probe_data, *pd = &probe_data; |
439 ByteIOContext *pb = NULL; | 439 ByteIOContext *pb = NULL; |
440 void *logctx= ap && ap->prealloced_context ? *ic_ptr : NULL; | |
440 | 441 |
441 pd->filename = ""; | 442 pd->filename = ""; |
442 if (filename) | 443 if (filename) |
443 pd->filename = filename; | 444 pd->filename = filename; |
444 pd->buf = NULL; | 445 pd->buf = NULL; |
476 } | 477 } |
477 /* guess file format */ | 478 /* guess file format */ |
478 fmt = av_probe_input_format2(pd, 1, &score); | 479 fmt = av_probe_input_format2(pd, 1, &score); |
479 if(fmt){ | 480 if(fmt){ |
480 if(score <= AVPROBE_SCORE_MAX/4){ //this can only be true in the last iteration | 481 if(score <= AVPROBE_SCORE_MAX/4){ //this can only be true in the last iteration |
481 av_log(*ic_ptr, AV_LOG_WARNING, "Format detected only with low score of %d, misdetection possible!\n", score); | 482 av_log(logctx, AV_LOG_WARNING, "Format detected only with low score of %d, misdetection possible!\n", score); |
482 }else | 483 }else |
483 av_log(*ic_ptr, AV_LOG_DEBUG, "Probed with size=%d and score=%d\n", probe_size, score); | 484 av_log(logctx, AV_LOG_DEBUG, "Probed with size=%d and score=%d\n", probe_size, score); |
484 } | 485 } |
485 } | 486 } |
486 av_freep(&pd->buf); | 487 av_freep(&pd->buf); |
487 } | 488 } |
488 | 489 |