Reviewed-by: Stephen Hutchinson <qyot27@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
... | ... |
@@ -423,10 +423,10 @@ static void avisynth_next_stream(AVFormatContext *s, AVStream **st, |
423 | 423 |
{ |
424 | 424 |
AviSynthContext *avs = s->priv_data; |
425 | 425 |
|
426 |
- pkt->stream_index = avs->curr_stream++; |
|
426 |
+ avs->curr_stream++; |
|
427 | 427 |
avs->curr_stream %= s->nb_streams; |
428 | 428 |
|
429 |
- *st = s->streams[pkt->stream_index]; |
|
429 |
+ *st = s->streams[avs->curr_stream]; |
|
430 | 430 |
if ((*st)->discard == AVDISCARD_ALL) |
431 | 431 |
*discard = 1; |
432 | 432 |
else |
... | ... |
@@ -454,10 +454,6 @@ static int avisynth_read_packet_video(AVFormatContext *s, AVPacket *pkt, |
454 | 454 |
if (discard) |
455 | 455 |
return 0; |
456 | 456 |
|
457 |
- pkt->pts = n; |
|
458 |
- pkt->dts = n; |
|
459 |
- pkt->duration = 1; |
|
460 |
- |
|
461 | 457 |
#ifdef USING_AVISYNTH |
462 | 458 |
/* Define the bpp values for the new AviSynth 2.6 colorspaces. |
463 | 459 |
* Since AvxSynth doesn't have these functions, special-case |
... | ... |
@@ -485,6 +481,11 @@ static int avisynth_read_packet_video(AVFormatContext *s, AVPacket *pkt, |
485 | 485 |
if (av_new_packet(pkt, pkt->size) < 0) |
486 | 486 |
return AVERROR(ENOMEM); |
487 | 487 |
|
488 |
+ pkt->pts = n; |
|
489 |
+ pkt->dts = n; |
|
490 |
+ pkt->duration = 1; |
|
491 |
+ pkt->stream_index = avs->curr_stream; |
|
492 |
+ |
|
488 | 493 |
frame = avs_library.avs_get_frame(avs->clip, n); |
489 | 494 |
error = avs_library.avs_clip_get_error(avs->clip); |
490 | 495 |
if (error) { |
... | ... |
@@ -561,10 +562,6 @@ static int avisynth_read_packet_audio(AVFormatContext *s, AVPacket *pkt, |
561 | 561 |
if (discard) |
562 | 562 |
return 0; |
563 | 563 |
|
564 |
- pkt->pts = n; |
|
565 |
- pkt->dts = n; |
|
566 |
- pkt->duration = samples; |
|
567 |
- |
|
568 | 564 |
pkt->size = avs_bytes_per_channel_sample(avs->vi) * |
569 | 565 |
samples * avs->vi->nchannels; |
570 | 566 |
if (!pkt->size) |
... | ... |
@@ -573,6 +570,11 @@ static int avisynth_read_packet_audio(AVFormatContext *s, AVPacket *pkt, |
573 | 573 |
if (av_new_packet(pkt, pkt->size) < 0) |
574 | 574 |
return AVERROR(ENOMEM); |
575 | 575 |
|
576 |
+ pkt->pts = n; |
|
577 |
+ pkt->dts = n; |
|
578 |
+ pkt->duration = samples; |
|
579 |
+ pkt->stream_index = avs->curr_stream; |
|
580 |
+ |
|
576 | 581 |
avs_library.avs_get_audio(avs->clip, pkt->data, n, samples); |
577 | 582 |
error = avs_library.avs_clip_get_error(avs->clip); |
578 | 583 |
if (error) { |