[MPlayer-dev-eng] PATCH - Resubmitting get_property chapters patch

Mathieu SCHROETER mathieu.schroeter at gamesover.ch
Mon Sep 22 21:49:28 CEST 2008


Nico Sabbi a écrit :
>> Index: mplayer.c
>> ===================================================================
>> --- mplayer.c   (revision 27636)
>> +++ mplayer.c   (working copy)
>> @@ -3530,6 +3530,12 @@
>>    }
>>    mp_msg(MSGT_IDENTIFY,MSGL_INFO,"ID_LENGTH=%.2lf\n",
>> demuxer_get_time_length(mpctx->demuxer));
>>    mp_msg(MSGT_IDENTIFY,MSGL_INFO,"ID_SEEKABLE=%d\n",
>> mpctx->stream->seek ? 1 : 0);
>> +  if (mpctx->demuxer) {
>> +      if (mpctx->demuxer->num_chapters == 0)
>> +         if (mpctx->demuxer->stream)
>> +             stream_control(mpctx->demuxer->stream,
>> STREAM_CTRL_GET_NUM_CHAPTERS, &mpctx->demuxer->num_chapters);
>> +      mp_msg(MSGT_IDENTIFY,MSGL_INFO,"ID_CHAPTERS=%d\n",
>> mpctx->demuxer->num_chapters);
>> +  } 
> 
> 
> there can't be a demuxer without un underlying stream
> 
>>  
>>  if(!mpctx->sh_video) goto main; // audio-only
>>  
>> Index: command.c
>> ===================================================================
>> --- command.c   (revision 27636)
>> +++ command.c   (working copy)
>> @@ -447,6 +447,18 @@
>>      return M_PROPERTY_OK;
>>  }
>>  
>> +/// Number of chapters in file
>> +static int mp_property_chapters(m_option_t *prop, int action, void
>> *arg,
>> +                               MPContext *mpctx)
>> +{
>> +    if (!mpctx->demuxer)
>> +       return M_PROPERTY_UNAVAILABLE;
>> +    if (mpctx->demuxer->num_chapters == 0)
>> +       if (mpctx->demuxer->stream)
>> +           stream_control(mpctx->demuxer->stream,
>> STREAM_CTRL_GET_NUM_CHAPTERS, &mpctx->demuxer->num_chapters);
>> +    return m_property_int_ro(prop, action, arg,
>> mpctx->demuxer->num_chapters);
>> +}
>> +
> 
> same as above

Here, It is possible, see here:

http://lists.mplayerhq.hu/pipermail/mplayer-cvslog/2008-August/035184.html

Regards,
Mathieu



More information about the MPlayer-dev-eng mailing list