On Mon, 27 Feb 2012 14:12:54 -0500, Justin Ruggles <[email protected]> wrote: > Each packet has 18 sectors with 224/channels samples in each sector. > --- > libavformat/psxstr.c | 9 ++++++++- > 1 files changed, 8 insertions(+), 1 deletions(-) > > diff --git a/libavformat/psxstr.c b/libavformat/psxstr.c > index 988d1f0..fcdbabf 100644 > --- a/libavformat/psxstr.c > +++ b/libavformat/psxstr.c > @@ -56,6 +56,7 @@ typedef struct StrChannel { > > /* audio parameters */ > int audio_stream_index; > + int64_t next_audio_pts; > } StrChannel; > > typedef struct StrDemuxContext { > @@ -224,13 +225,19 @@ static int str_read_packet(AVFormatContext *s, > // st->codec->bit_rate = 0; //FIXME; > st->codec->block_align = 128; > > - avpriv_set_pts_info(st, 64, 128, st->codec->sample_rate); > + avpriv_set_pts_info(st, 64, 18 * 224 / st->codec->channels, > + st->codec->sample_rate); > + str->channels[channel].next_audio_pts = 0; > } > pkt = ret_pkt; > if (av_new_packet(pkt, 2304)) > return AVERROR(EIO); > memcpy(pkt->data,sector+24,2304); > > + pkt->duration = 1; > + pkt->pts = str->channels[channel].next_audio_pts; > + str->channels[channel].next_audio_pts++;
Why not just add the ++ to the line above? Otherwise ok. -- Anton Khirnov _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
