[FFmpeg-devel] [PATCH] Fix MPEG-TS seek and frame positions in general

Baptiste Coudurier baptiste.coudurier
Tue Feb 17 02:58:14 CET 2009


Ivan Schreter wrote:
> [...]
>  
>  /* return non zero if a packet could be constructed */
>  static void mpegts_push_data(MpegTSFilter *filter,
> -                             const uint8_t *buf, int buf_size, int is_start)
> +                             const uint8_t *buf, int buf_size, int is_start,
> +                             int64_t pos)
>  {
>      PESContext *pes = filter->u.pes_filter.opaque;
>      MpegTSContext *ts = pes->ts;
> @@ -823,6 +825,8 @@
>      if (is_start) {
>          pes->state = MPEGTS_HEADER;
>          pes->data_index = 0;
> +        /* Note: file position points just after the TS packet, so subtract it */
> +        pes->stream_pos = pos >= ts->raw_packet_size ? (pos - ts->raw_packet_size) : -1;

Maybe ts->pos47 could be changed to store the offset of the last 0x47
byte, get_pcr might will need change.

Besides I think stream_pos cannot be -1, there should be 0x47 byte
before in any case, no ?

[...]

-- 
Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
checking for life_signs in -lkenny... no
FFmpeg maintainer                                  http://www.ffmpeg.org




More information about the ffmpeg-devel mailing list