On 07/21/2012 05:52 PM, Måns Rullgård wrote:
> "Ronald S. Bultje" <[email protected]> writes:
> 
>> From: "Ronald S. Bultje" <[email protected]>
>>
>> ---
>>  libavformat/asfenc.c      |   12 ++----------
>>  libavformat/avienc.c      |    6 +-----
>>  libavformat/flvenc.c      |    6 +-----
>>  libavformat/matroskaenc.c |   21 ++++++---------------
>>  libavformat/movenc.c      |   21 ++++++---------------
>>  libavformat/nutenc.c      |    9 ++-------
>>  6 files changed, 18 insertions(+), 57 deletions(-)
>>
>> diff --git a/libavformat/asfenc.c b/libavformat/asfenc.c
>> index e45232d..a8814eb 100644
>> --- a/libavformat/asfenc.c
>> +++ b/libavformat/asfenc.c
>> @@ -884,11 +884,7 @@ AVOutputFormat ff_asf_muxer = {
>>      .mime_type      = "video/x-ms-asf",
>>      .extensions     = "asf,wmv,wma",
>>      .priv_data_size = sizeof(ASFContext),
>> -#if CONFIG_LIBMP3LAME
>> -    .audio_codec    = CODEC_ID_MP3,
>> -#else
>> -    .audio_codec    = CODEC_ID_MP2,
>> -#endif
>> +    .audio_codec    = CONFIG_LIBMP3LAME ? CODEC_ID_MP3 : CODEC_ID_MP2,
> 
> Patch OK, but what does it fix?

The aim is to not have define nests in the struct.

While we are at it could we make the default codecs selection a little
more robust.

My idea is to introduce a CODEC_ID_COPY to be used as last fallback and have

#if CONFIG_${codec1}
#define ${format_name}_DEFAULT_VIDEO_CODEC CODEC_ID_${codec1}
#elif CONFIG_${codec2}
..
#else
#define ${format_name}_DEFAULT_VIDEO_CODEC CODEC_ID_COPY
#fi

Making so that if the default codec is missing you can still streamcopy
from a format to another as default action instead of silently losing
the stream.

lu


-- 

Luca Barbato
Gentoo/linux
http://dev.gentoo.org/~lu_zero

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to