Web lists-archives.com

Re: [MPlayer-dev-eng] Bluray input with -demuxer lavf




On Thu, Sep 18, 2014 at 02:06:04PM +0100, Andy Furniss wrote:
> Reimar Döffinger wrote:
> >On 18 September 2014 00:40:14 CEST, Andy Furniss <adf.lists@xxxxxxxxx> wrote:
> 
> >>On all 3 of my disks (on HD) lavf now works without cache and seeking
> >>works on 2 of them.
> >>
> >>One just gets EOF when seeking with lavf with or without cache, it
> >>works
> >>without lavf.
> >>
> >>There are two differences from the working - it's encrypted and it's
> >>also made up of lots of small .m2ts for multilingual reasons I guess
> >>whereas the other 2 the main film is just one large .m2ts.
> >
> >I would bet that if you dumpstream'd the title and tried to seek in ffplay you'd get the same issue.
> 
> Yes, ffplay can't seek properly on a dumpstream.

Could you try attached patch (for FFmpeg) on the bluray?
I have not tested it at all though.
>From 753f707a9c4b1e8aec24c50da02a2afe89ccfa5d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Reimar=20D=C3=B6ffinger?= <Reimar.Doeffinger@xxxxxx>
Date: Sun, 21 Sep 2014 10:14:57 +0100
Subject: [PATCH] [RFC] mpegts: Support seeking based on stream timestamps.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Should should fix seeking in some blurays in combination with
e.g. MPlayer.
Not yet tested due to no bluray at hand.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@xxxxxx>
---
 libavformat/mpegts.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 3434341..c04e156 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -2659,6 +2659,12 @@ void ff_mpegts_parse_close(MpegTSContext *ts)
     av_free(ts);
 }
 
+static int mpegts_read_seek(AVFormatContext *s, int stream_index,
+                            int64_t ts, int flags)
+{
+    return avio_seek_time(s->pb, stream_index, ts, flags);
+}
+
 AVInputFormat ff_mpegts_demuxer = {
     .name           = "mpegts",
     .long_name      = NULL_IF_CONFIG_SMALL("MPEG-TS (MPEG-2 Transport Stream)"),
@@ -2668,6 +2674,7 @@ AVInputFormat ff_mpegts_demuxer = {
     .read_packet    = mpegts_read_packet,
     .read_close     = mpegts_read_close,
     .read_timestamp = mpegts_get_dts,
+    .read_seek      = mpegts_read_seek,
     .flags          = AVFMT_SHOW_IDS | AVFMT_TS_DISCONT,
     .priv_class     = &mpegts_class,
 };
@@ -2680,6 +2687,7 @@ AVInputFormat ff_mpegtsraw_demuxer = {
     .read_packet    = mpegts_raw_read_packet,
     .read_close     = mpegts_read_close,
     .read_timestamp = mpegts_get_dts,
+    .read_seek      = mpegts_read_seek,
     .flags          = AVFMT_SHOW_IDS | AVFMT_TS_DISCONT,
     .priv_class     = &mpegtsraw_class,
 };
-- 
1.9.1

_______________________________________________
MPlayer-dev-eng mailing list
MPlayer-dev-eng@xxxxxxxxxxxx
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng