[MPlayer-dev-eng] [PATCH] EDL changes: loadfile and adjust pts functionality

Vlad Seryakov vseryakov at gmail.com
Thu Sep 2 01:45:22 CEST 2010


On Sep 1, 2010, at 7:26 PM, Reynaldo H. Verdejo Pinochet wrote:

> Hi Vlad
> 
> On Wed, Sep 01, 2010 at 04:04:38PM -0400, Vlad Seryakov wrote:
>> 
>> On Sep 1, 2010, at 1:57 PM, Reynaldo H. Verdejo Pinochet wrote:
>> 
>> [..]
>>>> +          edl_filename = strdup(cmd->args[0].v.s);
>>>> +          edl_loadfile();
>>>> +          break;    
>>>> +      }
>>> 
>>> if(cmd->id == MP_CMD_EDL_LOADFILE)?
>>> 
>>> Also, I keep thinking checking for NULL in the malloced strdup
>>> returning pointer an terminating if out of mem might be wise,
>>> it certainly wouldn't hurt but I dunno what others might say.
>>> 
>> In case of NULL it will not just load any edl file which is not fatal but i added error message to detect such cases.
>> New patch attached
> 
> Sure. It been a failed memory allocation makes it worth
> checking for though.
> 
>> ===================================================================
>> --- mplayer.c	(revision 32011)
>> +++ mplayer.c	(working copy)
>> @@ -2611,6 +2611,13 @@
>>     }
>> }
>> 
>> +static void edl_loadfile(void)
>> +{
>> +    if (edl_filename) {
>> +        if (edl_records) {
>> +            free_edl(edl_records);
>> +        }
> 
> Pointless {}
> 
>> [...]
>> if (edl_output_filename) {
>>     if (edl_fd) fclose(edl_fd);
>>     if ((edl_fd = fopen(edl_output_filename, "w")) == NULL)
>> @@ -3971,6 +3975,13 @@
>>   int brk_cmd = 0;
>>   while( !brk_cmd && (cmd = mp_input_get_cmd(0,0,0)) != NULL) {
>>       brk_cmd = run_command(mpctx, cmd);
>> +      if (cmd->id == MP_CMD_EDL_LOADFILE) {
>> +          if (edl_filename) free(edl_filename);
>> +          edl_filename = strdup(cmd->args[0].v.s);
>> +          if (!edl_filename) {
>> +              mp_msg(MSGT_CPLAYER, MSGL_ERR, "cannot allocate memory for EDL file name: %s", cmd->args[0].v.s);
> 
> Should be translatable and start with uppercase..
> 

Fixed, 

i only add to help_mp-en.h, right?

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: edlfile.txt
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20100901/d8f3ff0b/attachment-0001.txt>
-------------- next part --------------






More information about the MPlayer-dev-eng mailing list