libeplayer3: minor changes

Origin commit data
------------------
Branch: master
Commit: e80f8646e7
Author: martii <m4rtii@gmx.de>
Date: 2013-07-07 (Sun, 07 Jul 2013)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
martii
2013-07-07 15:59:55 +02:00
parent 4262df3bb0
commit da5eb57d72
3 changed files with 19 additions and 9 deletions

View File

@@ -728,6 +728,9 @@ static void FFMPEGThread(Context_t *context) {
if (context->output->audio->Write(context, &avOut) < 0) if (context->output->audio->Write(context, &avOut) < 0)
ffmpeg_err("writing data to audio device failed\n"); ffmpeg_err("writing data to audio device failed\n");
av_freep(&output); av_freep(&output);
#ifdef USE_LIBSWRESAMPLE
currentAudioPts = pts = swr_next_pts(swr, INT64_MIN);
#endif
} }
} }
else if (audioTrack->have_aacheader == 1) else if (audioTrack->have_aacheader == 1)
@@ -1681,8 +1684,8 @@ static int container_ffmpeg_seek_rel(Context_t *context, off_t pos, long long in
return cERR_CONTAINER_FFMPEG_ERR; return cERR_CONTAINER_FFMPEG_ERR;
} }
context->output->Command(context, OUTPUT_FLUSH, NULL); // martii context->output->Command(context, OUTPUT_FLUSH, NULL);
context->output->Command(context, OUTPUT_PLAY, NULL); // martii context->output->Command(context, OUTPUT_PLAY, NULL);
latestPts = 0; latestPts = 0;
#if 1 #if 1
if (videoTrack && videoTrack->stream && ((AVStream*) videoTrack->stream)->codec && ((AVStream*) videoTrack->stream)->codec->codec) if (videoTrack && videoTrack->stream && ((AVStream*) videoTrack->stream)->codec && ((AVStream*) videoTrack->stream)->codec->codec)
@@ -1800,8 +1803,8 @@ static int container_ffmpeg_seek(Context_t *context, float sec, int absolute) {
return cERR_CONTAINER_FFMPEG_ERR; return cERR_CONTAINER_FFMPEG_ERR;
} }
context->output->Command(context, OUTPUT_FLUSH, NULL); // martii context->output->Command(context, OUTPUT_FLUSH, NULL);
context->output->Command(context, OUTPUT_PLAY, NULL); // martii context->output->Command(context, OUTPUT_PLAY, NULL);
latestPts = 0; latestPts = 0;
#if 1 #if 1
if (videoTrack && videoTrack->stream && ((AVStream*) videoTrack->stream)->codec && ((AVStream*) videoTrack->stream)->codec->codec) if (videoTrack && videoTrack->stream && ((AVStream*) videoTrack->stream)->codec && ((AVStream*) videoTrack->stream)->codec->codec)

View File

@@ -163,7 +163,12 @@ status = 1;
/* Functions */ /* Functions */
/* ***************************** */ /* ***************************** */
static int PlaybackStop(Context_t *context);
static int PlaybackOpen(Context_t *context, char * uri) { static int PlaybackOpen(Context_t *context, char * uri) {
if (context->playback->isPlaying)
PlaybackStop(context);
playback_printf(10, "URI=%s\n", uri); playback_printf(10, "URI=%s\n", uri);
context->playback->uri = strdup(uri); context->playback->uri = strdup(uri);
@@ -311,7 +316,8 @@ static int PlaybackOpen(Context_t *context, char * uri) {
} }
else else
{ {
playback_err("playback alread running\n"); playback_err("playback already running\n");
return cERR_PLAYBACK_ERROR; return cERR_PLAYBACK_ERROR;
} }
@@ -488,7 +494,7 @@ static int PlaybackStop(Context_t *context) {
playback_printf(10, "\n"); playback_printf(10, "\n");
if (context->playback->isPlaying) { if (context && context->playback && context->playback->isPlaying) {
context->playback->isPaused = 0; context->playback->isPaused = 0;
context->playback->isPlaying = 0; context->playback->isPlaying = 0;

View File

@@ -267,12 +267,13 @@ bool cPlayback::Start(char *filename, unsigned short vpid, int vtype, unsigned s
bool cPlayback::Stop(void) bool cPlayback::Stop(void)
{ {
printf("%s:%s playing %d\n", FILENAME, __FUNCTION__, playing); printf("%s:%s playing %d\n", FILENAME, __FUNCTION__, playing);
if(playing==false) return false; //if(playing==false) return false;
if(player && player->playback && player->output) { if(player && player->playback)
player->playback->Command(player, PLAYBACK_STOP, NULL); player->playback->Command(player, PLAYBACK_STOP, NULL);
if(player && player->output)
player->output->Command(player, OUTPUT_CLOSE, NULL); player->output->Command(player, OUTPUT_CLOSE, NULL);
}
if(player && player->output) { if(player && player->output) {
player->output->Command(player,OUTPUT_DEL, (void*)"audio"); player->output->Command(player,OUTPUT_DEL, (void*)"audio");