How to repeatedly play a matroska file?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

How to repeatedly play a matroska file?

Alex Song-2

I want to repeatedly play a matroska file. I call av_read_frame in a while(1) and when when eof is detected, I use

av_seek_frame(fc, ps->video_stream, 0, AVSEEK_FLAG_BYTE);
av_seek_frame(fc, ps->audio_stream, 0, AVSEEK_FLAG_BYTE);


url_fseek(fc->pb, 0, SEEK_SET);

to go the the beginning of the file and start over the above again.

This works fine with avi file. But for mkv file, it doesn't work. The first approach gives me mkv demuxing errors, the second approach doesn't give me demuxing error but av_read_frame returns error -5.

What is the correct way to repeatedly play a file? How to make it work on Matroska file?

Thanks a lot,


Be smarter than spam. See how smart SpamGuard is at giving junk email the boot with the All-new Yahoo! Mail.  Click on Options in Mail and switch to New Mail today or register for free at
libav-user mailing list
[hidden email]