[FFmpeg-cvslog] r25596 - trunk/ffmpeg.c

Ramiro Polla ramiro.polla
Sun Oct 31 20:37:58 CET 2010


On Thu, Oct 28, 2010 at 11:20 AM, stefano <subversion at mplayerhq.hu> wrote:
> Author: stefano
> Date: Thu Oct 28 15:20:26 2010
> New Revision: 25596
>
> Log:
> Factorize: opt_{audio,video,subtitle}_tag() -> opt_codec_tag().
>
> Modified:
> ? trunk/ffmpeg.c
>
> Modified: trunk/ffmpeg.c
> ==============================================================================
> --- trunk/ffmpeg.c ? ? ?Thu Oct 28 14:15:50 2010 ? ? ? ?(r25595)
> +++ trunk/ffmpeg.c ? ? ?Thu Oct 28 15:20:26 2010 ? ? ? ?(r25596)
> @@ -2819,24 +2819,6 @@ static void opt_audio_codec(const char *
> ? ? opt_codec(&audio_stream_copy, &audio_codec_name, AVMEDIA_TYPE_AUDIO, arg);
> ?}
>
> -static void opt_audio_tag(const char *arg)
> -{
> - ? ?char *tail;
> - ? ?audio_codec_tag= strtol(arg, &tail, 0);
> -
> - ? ?if(!tail || *tail)
> - ? ? ? ?audio_codec_tag= arg[0] + (arg[1]<<8) + (arg[2]<<16) + (arg[3]<<24);
> -}
> -
> -static void opt_video_tag(const char *arg)
> -{
> - ? ?char *tail;
> - ? ?video_codec_tag= strtol(arg, &tail, 0);
> -
> - ? ?if(!tail || *tail)
> - ? ? ? ?video_codec_tag= arg[0] + (arg[1]<<8) + (arg[2]<<16) + (arg[3]<<24);
> -}
> -
> ?static void opt_video_codec(const char *arg)
> ?{
> ? ? opt_codec(&video_stream_copy, &video_codec_name, AVMEDIA_TYPE_VIDEO, arg);
> @@ -2847,13 +2829,18 @@ static void opt_subtitle_codec(const cha
> ? ? opt_codec(&subtitle_stream_copy, &subtitle_codec_name, AVMEDIA_TYPE_SUBTITLE, arg);
> ?}
>
> -static void opt_subtitle_tag(const char *arg)
> +static void opt_codec_tag(const char *opt, const char *arg)
> ?{
> ? ? char *tail;
> - ? ?subtitle_codec_tag= strtol(arg, &tail, 0);
> + ? ?uint32_t *codec_tag;
>
> - ? ?if(!tail || *tail)
> - ? ? ? ?subtitle_codec_tag= arg[0] + (arg[1]<<8) + (arg[2]<<16) + (arg[3]<<24);
> + ? ?codec_tag = !strcmp(opt, "atag") ? &audio_codec_tag :
> + ? ? ? ? ? ? ? ?!strcmp(opt, "vtag") ? &video_codec_tag :
> + ? ? ? ? ? ? ? ?!strcmp(opt, "stag") ? &subtitle_codec_tag : NULL;
> +
> + ? ?*codec_tag = strtol(arg, &tail, 0);
> + ? ?if (!tail || *tail)
> + ? ? ? ?*codec_tag = arg[0] + (arg[1]<<8) + (arg[2]<<16) + (arg[3]<<24);
> ?}

OPT_FUNC2 must return a value. This broke some tests for example:
http://fate.arrozcru.org/history.cgi?slot=sparc-linux-gcc-4.1

patch attached.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: opt_codec_tag_ret.diff
Type: application/octet-stream
Size: 877 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-cvslog/attachments/20101031/be919d7b/attachment.obj>



More information about the ffmpeg-cvslog mailing list