[MPlayer-dev-eng] [PATCH] Support ffmpeg per-codec avoptions
Reimar Döffinger
Reimar.Doeffinger at gmx.de
Sun Apr 24 08:18:43 CEST 2011
On 24 Apr 2011, at 02:34, Philip Langdale <philipl at overt.org> wrote:
> On Thu, 21 Apr 2011 19:40:55 +0200
> Reimar Döffinger <Reimar.Doeffinger at gmx.de> wrote:
>
>> On Wed, Apr 20, 2011 at 03:47:54PM -0700, Philip Langdale wrote:
>>> Currently, mplayer does not expose ffmpeg per-codec
>>> avoptions, which is unfortunate, but not terribly hard
>>> to fix.
>>>
>>> This extends the existing "-lavdopts o=foo" mechanism
>>> to compare foo with the per-codec options.
>>
>> If it works that should be ok.
>>
>>> @@ -344,7 +345,9 @@ static int init(sh_video_t *sh){
>>> avctx->skip_frame = str2AVDiscard(lavc_param_skip_frame_str);
>>>
>>> if(lavc_avopt){
>>> - if(parse_avopts(avctx, lavc_avopt) < 0){
>>> + if (parse_avopts(avctx, lavc_avopt) < 0 &&
>>> + (!lavc_codec->priv_class || !avctx->priv_data ||
>>> + parse_avopts(avctx->priv_data, lavc_avopt) < 0)) {
>>
>> Wouldn't it be possible and nicer to change parse_avopts so you don't
>> need thw two extra NULL checks? I have no idea, I was just thinking.
>
> It would be a little awkward. You'd have to pass the lavc_codec in
> as a separate argument (can't set the codec in on your own -
> avcodec_open has to do it) and then give parse_avopts knowledge of
> the types - right now it takes a void*.
I somehow doubt that. At least the priv_data check should be easy to avoid by making parse_avopts return an error if the first argument is NULL...
More information about the MPlayer-dev-eng
mailing list