Mercurial > libavformat.hg
comparison utils.c @ 3777:d4b086282604 libavformat
When setting codec_id during codec probe we must also set codec_type.
author | andoma |
---|---|
date | Mon, 25 Aug 2008 15:39:43 +0000 |
parents | 93d4898d9b6e |
children | db75e26da599 |
comparison
equal
deleted
inserted
replaced
3776:8329c0373f69 | 3777:d4b086282604 |
---|---|
350 { | 350 { |
351 AVInputFormat *fmt; | 351 AVInputFormat *fmt; |
352 fmt = av_probe_input_format2(pd, 1, &score); | 352 fmt = av_probe_input_format2(pd, 1, &score); |
353 | 353 |
354 if (fmt) { | 354 if (fmt) { |
355 if (!strcmp(fmt->name, "mp3")) | 355 if (!strcmp(fmt->name, "mp3")) { |
356 st->codec->codec_id = CODEC_ID_MP3; | 356 st->codec->codec_id = CODEC_ID_MP3; |
357 else if (!strcmp(fmt->name, "ac3")) | 357 st->codec->codec_type = CODEC_TYPE_AUDIO; |
358 } else if (!strcmp(fmt->name, "ac3")) { | |
358 st->codec->codec_id = CODEC_ID_AC3; | 359 st->codec->codec_id = CODEC_ID_AC3; |
359 else if (!strcmp(fmt->name, "mpegvideo")) | 360 st->codec->codec_type = CODEC_TYPE_AUDIO; |
361 } else if (!strcmp(fmt->name, "mpegvideo")) { | |
360 st->codec->codec_id = CODEC_ID_MPEG2VIDEO; | 362 st->codec->codec_id = CODEC_ID_MPEG2VIDEO; |
361 else if (!strcmp(fmt->name, "h264")) | 363 st->codec->codec_type = CODEC_TYPE_VIDEO; |
364 } else if (!strcmp(fmt->name, "h264")) { | |
362 st->codec->codec_id = CODEC_ID_H264; | 365 st->codec->codec_id = CODEC_ID_H264; |
366 st->codec->codec_type = CODEC_TYPE_VIDEO; | |
367 } | |
363 } | 368 } |
364 return !!fmt; | 369 return !!fmt; |
365 } | 370 } |
366 | 371 |
367 /************************************************************/ | 372 /************************************************************/ |