Opened 4 years ago

#3672 new defect

av_read_frame failed after av_seek_frame(0) called

Reported by: hxuanyu Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

I built a test program with latest ffmpeg git header

the test code calls av_seek_frame(0) when av_read_frame returns < 0; while seek succeeded, all subsequent call to av_read_frame failed.

while this failed with latest ffmpeg it succeeded with ffmpeg-2.0.1

while (av_read_frame(pFormatCtx, &pkt) >= 0) {

printf("packet %d\n", count++);

}

ret = av_seek_frame(pFormatCtx, video_stream_idx, 0, AVSEEK_FLAG_BACKWARD);
if (ret < 0) {

printf("seek to 0 failed\n");
return 0;

} else { printf("seek ok\n"); }

av_init_packet(&pkt);
ret = av_read_frame(pFormatCtx, &pkt);
if (ret < 0) {

printf("read after seek failed *\n");

} else {

printf("read ok after seek(0)\n");

}

Attachments (3)

test.c (3.8 KB) - added by hxuanyu 4 years ago.
output_from_latest_and_2.0.1 (3.8 KB) - added by hxuanyu 4 years ago.
av_rv10_15_yuv420p_ac3_16000_2_0.rm (1.0 MB) - added by hxuanyu 4 years ago.
sample file

Download all attachments as: .zip

Change History (3)

Changed 4 years ago by hxuanyu

Changed 4 years ago by hxuanyu

Changed 4 years ago by hxuanyu

sample file

Note: See TracTickets for help on using tickets.