History

Make ffplay pass the packet.pos information to the filterchain, get it again from the filterchain and pass it back to output_picture2().

Originally committed as revision 22507 to svn://svn.ffmpeg.org/ffmpeg/trunk

Stefano Sabatini committed 16 years ago

Commit bb409511 parent 5bb5c1d1 file · +6 −4Browse files

Unified · Split

ffplay.c+6−4
@@ -1594,6 +1594,7 @@ static int input_request_frame(AVFilterLink *link) · 1593 unmodified lines
15941594 av_free_packet(&pkt);
15951595
15961596 picref->pts = pts;
1597+ picref->pos = pkt.pos;
15971598 picref->pixel_aspect = priv->is->video_st->codec->sample_aspect_ratio;
15981599 avfilter_start_frame(link, avfilter_ref_pic(picref, ~0));
15991600 avfilter_draw_slice(link, 0, link->h, 1);
@@ -1657,7 +1658,7 @@ static int output_query_formats(AVFilterContext *ctx) · 57 unmodified lines
16571658 }
16581659
16591660 static int get_filtered_video_frame(AVFilterContext *ctx, AVFrame *frame,
1660− int64_t *pts)
1661+ int64_t *pts, int64_t *pos)
16611662 {
16621663 AVFilterPicRef *pic;
16631664
@@ -1669,6 +1670,7 @@ static int get_filtered_video_frame(AVFilterContext *ctx, AVFrame *frame, · 5 unmodified lines
16691670
16701671 frame->opaque = pic;
16711672 *pts = pic->pts;
1673+ *pos = pic->pos;
16721674
16731675 memcpy(frame->data, pic->data, sizeof(frame->data));
16741676 memcpy(frame->linesize, pic->linesize, sizeof(frame->linesize));
@@ -1695,7 +1697,7 @@ static int video_thread(void *arg) · 20 unmodified lines
16951697 {
16961698 VideoState *is = arg;
16971699 AVFrame *frame= avcodec_alloc_frame();
1698− int64_t pts_int;
1700+ int64_t pts_int, pos;
16991701 double pts;
17001702 int ret;
17011703
@@ -1748,7 +1750,7 @@ static int video_thread(void *arg) · 46 unmodified lines
17481750 while (is->paused && !is->videoq.abort_request)
17491751 SDL_Delay(10);
17501752 #if CONFIG_AVFILTER
1751− ret = get_filtered_video_frame(filt_out, frame, &pts_int);
1753+ ret = get_filtered_video_frame(filt_out, frame, &pts_int, &pos);
17521754 #else
17531755 ret = get_video_frame(is, frame, &pts_int, &pkt);
17541756 #endif
@@ -1761,7 +1763,7 @@ static int video_thread(void *arg) · 6 unmodified lines
17611763 pts = pts_int*av_q2d(is->video_st->time_base);
17621764
17631765 #if CONFIG_AVFILTER
1764− ret = output_picture2(is, frame, pts, -1); /* fixme: unknown pos */
1766+ ret = output_picture2(is, frame, pts, pos);
17651767 #else
17661768 ret = output_picture2(is, frame, pts, pkt.pos);
17671769 av_free_packet(&pkt);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t