aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-12-14 22:31:42 +0100
committerMichael Niedermayer <michaelni@gmx.at>2011-12-14 22:31:47 +0100
commitdc5f0018784895198919beb8a7bf47c423ed210f (patch)
treea531fca0beee5e9002be8b3decf519fd86fbe4a6
parente1ba29c76430ce511fd901c8b7a1bd199b169dc0 (diff)
parentefe8a1ba08dd868e5a96f5759258b0733bb2004c (diff)
downloadffmpeg-dc5f0018784895198919beb8a7bf47c423ed210f.tar.gz
Merge remote-tracking branch 'cus/stable'
* cus/stable: ffplay: clear pkt_temp when pkt is freed. ffplay: Fix got_frame type. ffplay: add 10 minute seek support to ffplay ffplay: force setting video mode on fullscreen toggle Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--doc/ffplay.texi3
-rw-r--r--ffplay.c21
2 files changed, 18 insertions, 6 deletions
diff --git a/doc/ffplay.texi b/doc/ffplay.texi
index b4d6dbcdcb..06666f6e59 100644
--- a/doc/ffplay.texi
+++ b/doc/ffplay.texi
@@ -168,6 +168,9 @@ Seek backward/forward 10 seconds.
@item down/up
Seek backward/forward 1 minute.
+@item page down/page up
+Seek backward/forward 10 minutes.
+
@item mouse click
Seek to percentage in file corresponding to fraction of width.
diff --git a/ffplay.c b/ffplay.c
index e391754863..f6168b5201 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -922,7 +922,7 @@ static void do_exit(VideoState *is)
exit(0);
}
-static int video_open(VideoState *is){
+static int video_open(VideoState *is, int force_set_video_mode){
int flags = SDL_HWSURFACE|SDL_ASYNCBLIT|SDL_HWACCEL;
int w,h;
@@ -949,7 +949,7 @@ static int video_open(VideoState *is){
h = 480;
}
if(screen && is->width == screen->w && screen->w == w
- && is->height== screen->h && screen->h == h)
+ && is->height== screen->h && screen->h == h && !force_set_video_mode)
return 0;
screen = SDL_SetVideoMode(w, h, 0, flags);
if (!screen) {
@@ -970,7 +970,7 @@ static int video_open(VideoState *is){
static void video_display(VideoState *is)
{
if(!screen)
- video_open(is);
+ video_open(is, 0);
if (is->audio_st && is->show_mode != SHOW_MODE_VIDEO)
video_audio_display(is);
else if (is->video_st)
@@ -2043,7 +2043,8 @@ static int audio_decode_frame(VideoState *is, double *pts_ptr)
AVPacket *pkt = &is->audio_pkt;
AVCodecContext *dec= is->audio_st->codec;
int len1, len2, data_size, resampled_data_size;
- int64_t dec_channel_layout, got_frame;
+ int64_t dec_channel_layout;
+ int got_frame;
double pts;
int new_packet = 0;
int flush_complete = 0;
@@ -2144,6 +2145,7 @@ static int audio_decode_frame(VideoState *is, double *pts_ptr)
/* free the current packet */
if (pkt->data)
av_free_packet(pkt);
+ memset(pkt_temp, 0, sizeof(*pkt_temp));
if (is->paused || is->audioq.abort_request) {
return -1;
@@ -2781,7 +2783,7 @@ static void toggle_full_screen(VideoState *is)
is->pictq[i].reallocate = 1;
}
#endif
- video_open(is);
+ video_open(is, 1);
}
static void toggle_pause(VideoState *is)
@@ -2850,6 +2852,12 @@ static void event_loop(VideoState *cur_stream)
case SDLK_w:
toggle_audio_display(cur_stream);
break;
+ case SDLK_PAGEUP:
+ incr = 600.0;
+ goto do_seek;
+ case SDLK_PAGEDOWN:
+ incr = -600.0;
+ goto do_seek;
case SDLK_LEFT:
incr = -10.0;
goto do_seek;
@@ -2933,7 +2941,7 @@ static void event_loop(VideoState *cur_stream)
do_exit(cur_stream);
break;
case FF_ALLOC_EVENT:
- video_open(event.user.data1);
+ video_open(event.user.data1, 0);
alloc_picture(event.user.data1);
break;
case FF_REFRESH_EVENT:
@@ -3119,6 +3127,7 @@ static int opt_help(const char *opt, const char *arg)
"s activate frame-step mode\n"
"left/right seek backward/forward 10 seconds\n"
"down/up seek backward/forward 1 minute\n"
+ "page down/page up seek backward/forward 10 minutes\n"
"mouse click seek to percentage in file corresponding to fraction of width\n"
);
return 0;