Author: fejj
Date: 2007-10-08 15:23:19 -0400 (Mon, 08 Oct 2007)
New Revision: 87119
Modified:
trunk/moon/src/ChangeLog
trunk/moon/src/media.cpp
trunk/moon/src/mplayer.cpp
trunk/moon/src/mplayer.h
Log:
2007-10-08 Jeffrey Stedfast <[EMAIL PROTECTED]>
* mplayer.cpp (Open): If the media has video, load the first video
frame.
(Seek): Same.
(AdvanceFrame): Fixed to "end" properly.
* media.cpp: Don't manually call DisplayFrame() anymore.
Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog 2007-10-08 19:04:41 UTC (rev 87118)
+++ trunk/moon/src/ChangeLog 2007-10-08 19:23:19 UTC (rev 87119)
@@ -1,3 +1,12 @@
+2007-10-08 Jeffrey Stedfast <[EMAIL PROTECTED]>
+
+ * mplayer.cpp (Open): If the media has video, load the first video
+ frame.
+ (Seek): Same.
+ (AdvanceFrame): Fixed to "end" properly.
+
+ * media.cpp: Don't manually call DisplayFrame() anymore.
+
2007-10-08 Rolf Bjarne Kvinge <[EMAIL PROTECTED]>
* xaml.cpp: Set the surface of newly created objects (where applicable).
Modified: trunk/moon/src/media.cpp
===================================================================
--- trunk/moon/src/media.cpp 2007-10-08 19:04:41 UTC (rev 87118)
+++ trunk/moon/src/media.cpp 2007-10-08 19:23:19 UTC (rev 87119)
@@ -483,7 +483,6 @@
Play ();
} else {
Pause ();
- mplayer->DisplayFrame ();
Invalidate ();
}
}
@@ -572,7 +571,6 @@
source->Stop (false);
- mplayer->DisplayFrame ();
Invalidate ();
}
@@ -613,7 +611,6 @@
// position is in ticks, while mplayer expects time in
milliseconds.
mplayer->Seek (position * 1000 / TIMESPANTICKS_IN_SECOND);
- mplayer->DisplayFrame ();
Invalidate ();
if (position != value->AsTimeSpan ()) {
Modified: trunk/moon/src/mplayer.cpp
===================================================================
--- trunk/moon/src/mplayer.cpp 2007-10-08 19:04:41 UTC (rev 87118)
+++ trunk/moon/src/mplayer.cpp 2007-10-08 19:23:19 UTC (rev 87119)
@@ -340,6 +340,9 @@
target_pts = audio->initial_pts;
}
+ if (video->stream_id != -1)
+ LoadVideoFrame ();
+
return true;
}
@@ -455,7 +458,7 @@
}
if (current_pts >= seek_pts && current_pts >= target_pts)
- return true;
+ return g_async_queue_length (video->queue) > 0;
while ((pkt = (Packet *) g_async_queue_try_pop (video->queue))) {
// always decode the frame or we get glitches in the screen
@@ -492,14 +495,14 @@
}
void
-MediaPlayer::DisplayFrame ()
+MediaPlayer::LoadVideoFrame ()
{
AVFrame *frame;
AVPacket pkt;
int redraw;
int rv;
- if (playing || video->stream_id == -1)
+ if (video->stream_id == -1)
return;
if (audio->pcm != NULL && audio->stream_id != -1)
@@ -752,9 +755,13 @@
StopThreads ();
- // seek to position
- av_seek_frame (av_ctx, stream_id, position, 0);
- seek_pts = position;
+ if (video->stream_id != -1) {
+ seek_pts = position;
+ LoadVideoFrame ();
+ } else {
+ av_seek_frame (av_ctx, stream_id, position, 0);
+ seek_pts = position;
+ }
if (playing) {
// Restart the audio/io threads
Modified: trunk/moon/src/mplayer.h
===================================================================
--- trunk/moon/src/mplayer.h 2007-10-08 19:04:41 UTC (rev 87118)
+++ trunk/moon/src/mplayer.h 2007-10-08 19:23:19 UTC (rev 87119)
@@ -59,7 +59,7 @@
~MediaPlayer ();
bool AdvanceFrame ();
- void DisplayFrame ();
+ void LoadVideoFrame ();
void Render (cairo_t *cr);
cairo_surface_t *GetSurface ();
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches