Commit 07f0b3dd authored by michael's avatar michael

Do not loose the '\n'.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@15424 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent af22b516
......@@ -140,7 +140,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
ass->event[i]= p;
while(*p && *p != '\n')
p++;
*p++ = 0;
p++;
}
qsort(ass->event, ass->event_count, sizeof(*ass->event), event_cmp);
......@@ -156,14 +156,15 @@ fail:
static int read_packet(AVFormatContext *s, AVPacket *pkt)
{
ASSContext *ass = s->priv_data;
uint8_t *p;
uint8_t *p, *end;
if(ass->event_index >= ass->event_count)
return AVERROR(EIO);
p= ass->event[ ass->event_index ];
av_new_packet(pkt, strlen(p));
end= strchr(p, '\n');
av_new_packet(pkt, end ? end-p+1 : strlen(p));
pkt->flags |= PKT_FLAG_KEY;
pkt->pos= p - ass->event_buffer + s->streams[0]->codec->extradata_size;
pkt->pts= pkt->dts= get_pts(p);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment