Changeset 1932 for branches/blt4/src


Ignore:
Timestamp:
Oct 25, 2010, 3:16:06 PM (14 years ago)
Author:
gah
Message:
 
Location:
branches/blt4/src/objects
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • branches/blt4/src/objects/Makefile.in

    r1897 r1932  
    116116  # include them in compilation
    117117  LIBS += -lavcodec -lavformat -lswscale
    118   HEADERS += RpMediaPlayer.h
    119   OBJS += RpMediaPlayer.o
     118  HEADERS += RpVideo.h
     119  OBJS += RpVideo.o
    120120endif
    121121
  • branches/blt4/src/objects/RpMediaPlayer.cc

    r1902 r1932  
    226226    return 0;
    227227}
     228/*
     229int packet_queue_put(PacketQueue *q, AVPacket *pkt) {
     230
     231  AVPacketList *pkt1;
     232  if(pkt != &flush_pkt && av_dup_packet(pkt) < 0) {
     233    return -1;
     234  }
     235    if(packet_queue_get(&is->audioq, pkt, 1) < 0) {
     236      return -1;
     237    }
     238    if(packet->data == flush_pkt.data) {
     239      avcodec_flush_buffers(is->audio_st->codec);
     240      continue;
     241    }
     242*/
     243
    228244
    229245int
     
    231247{
    232248    // status.addContext("Rappture::MediaPlayer::seek()");
     249    int stream_index= -1;
     250    int64_t seek_target = is->seek_pos;
     251
     252    if (is->videoStream >= 0) {
     253        stream_index = is->videoStream;
     254    } else if (is->audioStream >= 0) {
     255        stream_index = is->audioStream;
     256    }
     257
     258    if(stream_index>=0){
     259        seek_target= av_rescale_q(seek_target, AV_TIME_BASE_Q,
     260                      pFormatCtx->streams[stream_index]->time_base);
     261    }
     262    if(av_seek_frame(is->pFormatCtx, stream_index,
     263                    seek_target, is->seek_flags) < 0) {
     264        fprintf(stderr, "%s: error while seeking\n",
     265            is->pFormatCtx->filename);
     266    } else {
     267        /* handle packet queues... more later... */
     268        if(is->audioStream >= 0) {
     269            packet_queue_flush(&is->audioq);
     270            packet_queue_put(&is->audioq, &flush_pkt);
     271        }
     272        if(is->videoStream >= 0) {
     273            packet_queue_flush(&is->videoq);
     274            packet_queue_put(&is->videoq, &flush_pkt);
     275        }
     276    }
     277    is->seek_req = 0;
    233278    return 0;
    234279}
Note: See TracChangeset for help on using the changeset viewer.